digest. Cryptographic hashing   [3.4.3]

^math:digest[algorithm;string or file; $.format[hex|base64] $.hmac[key] ]

The method provides an ability to work with different cryptographic hashing algorithms.
It generates a hash for specified string or file.

The following algorithms are supported:
md5, sha1, sha256, sha512.
Depending on
format option the result will be returned as HEX file (default) or BASE64 string.

With option
hmac specified the data integrity will be checked based on specified private key and hash-based message authentication code (HMAC).



Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 23.10.2013