Skip to content
angerangel edited this page Mar 15, 2013 · 1 revision

USAGE

   CHECKSUM data /part length /tcp /secure /hash size /method word /key key-value

DESCRIPTION

Computes a checksum, CRC, or hash.

CHECKSUM is a native value.

ARGUMENTS

  • data -- Bytes to checksum (binary!)

REFINEMENTS

  • /part
    • length -- Length of data
  • /tcp -- Returns an Internet TCP 16-bit checksum
  • /secure -- Returns a cryptographically secure checksum
  • /hash -- Returns a hash value
    • size -- Size of the hash table (integer!)
  • /method -- Method to use
    • word -- Methods: SHA1 MD5 CRC32 (word!)
  • /key -- Returns keyed HMAC value
    • key-value -- Key to use (any-string!)

#SOURCE

checksum: make native! [  [
    "Computes a checksum, CRC, or hash."
    data [binary!] "Bytes to checksum"
    /part length "Length of data"
    /tcp "Returns an Internet TCP 16-bit checksum"
    /secure "Returns a cryptographically secure checksum"
    /hash "Returns a hash value"
    size [integer!] "Size of the hash table"
    /method "Method to use"
    word [word!] "Methods: SHA1 MD5 CRC32"
    /key "Returns keyed HMAC value"
    key-value [any-string!] "Key to use"
] ]
Clone this wiki locally