跳轉到內容

Rebol 程式設計/校驗和

來自華夏公益教科書,開放書籍,開放世界
CHECKSUM data /tcp /secure /hash size /method word /key key-value 

返回 CRC 或其他型別的校驗和。

CHECKSUM 是一個本機值。

  • data -- 要校驗和的資料(型別:any-string)
  • /tcp -- 返回網際網路 TCP 16 位校驗和。
  • /secure -- 返回密碼學安全的校驗和。
  • /hash -- 返回雜湊值
    • size -- 雜湊表的大小(型別:整數)
  • /method -- 要使用的方法
    • word -- 方法:SHA1 MD5(型別:單詞)
  • /key -- 返回帶金鑰的 HMAC 值
    • key-value -- 要使用的金鑰(型別:any-string)

原始碼

[編輯 | 編輯原始碼]
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"
]

華夏公益教科書