-INCLUDE 'digest.sno' handle = DIGEST_INIT(algorithm) DIGEST_UPDATE(handle,string) bytes = DIGEST_FINAL(handle) string = DIGEST_HEX(bytes) bytes = DIGEST(algorithm,string)
DIGEST_INIT takes a digest algorithm name (as listed by openssl help) and returns an opaque handle to an object. Not all algorithms are implemented by all versions of the openssl library. Older algorithms have known collision weaknesses, Newer algorithms (and longer hash outputs) are slower!
DIGEST_UPDATE incorporates the string into the hash. Additional calls should produce the same result as concatenating the input strings to a single update call.
DIGEST_FINAL returns a string of binary bytes with the hash value and deletes the object and handle.
DIGEST_HEX takes a string of binary bytes and returns a string of lower case hex string.
DIGEST takes an algorithm name and a string to hash, and returns binary bytes.
See snobol4zlib(3) for CRC32 and ADLER32 hash algorithms.