Rebol Programming/checksum

From Wikibooks, open books for an open world
< Rebol Programming
Jump to navigation Jump to search

USAGE:[edit | edit source]

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

DESCRIPTION:[edit | edit source]

Returns a CRC or other type of checksum.

CHECKSUM is a native value.

ARGUMENTS[edit | edit source]

  • data -- Data to checksum (Type: any-string)

REFINEMENTS[edit | edit source]

  • /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 (Type: integer)
  • /method -- Method to use
    • word -- Method: SHA1 MD5 (Type: word)
  • /key -- Returns keyed HMAC value
    • key-value -- Key to use (Type: any-string)

SOURCE CODE[edit | edit source]

checksum: native[
  "Returns a CRC or other type of checksum." 
  data [any-string!] "Data to checksum" 
  /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!] "Method: SHA1 MD5" 
  /key "Returns keyed HMAC value" 
  key-value [any-string!] "Key to use"
]