Skip to content

__hash__

builtin · libnexusinterp/corefcn/hash-proprietary.cc

: h = __hash__ (alg, str)

Compute a cryptographic digest of the text str.

The algorithm alg is chosen case-insensitively from "md2", "md4", "md5", "sha1", "sha224", "sha256", "sha384" and "sha512". The digest of the raw bytes of str is returned as a row of lower-case hexadecimal digits.

Numeric input is first converted to characters, and a character matrix contributes only its first row; both cases produce a warning. An empty str is hashed as the empty string.