src/nodejs/jscrc

    Dark Mode
Search:
Group by:

  • Cyclic redundancy check for JavaScript targets.

Example: cmd: -b:js -d:nodejs

import src/nodejs/jscrc
from std/sugar import dup

var x = "The quick brown fox jumps over the lazy dog."
crc32(x)  ## In-Place.
doAssert x == "519025E9"
doAssert "The quick brown fox jumps over the lazy dog.".dup(crc32) == "519025E9"  ## Out-Place.

var e = " "
crc32(e)  ## In-Place.
doAssert e == "E96CCF45"
doAssert " ".dup(crc32) == "E96CCF45"  ## Out-Place.

var z = ""
crc32(z)   ## In-Place.
doAssert z == "00000000"
doAssert "".dup(crc32) == "00000000"  ## Out-Place.

Procs

func crc32(input: var string) {....raises: [], tags: [].}