Skip to main content
load(@std//hash.axl, md5, sha1, sha224, sha256, sha384, sha512, blake2b, blake2s)
function md5
def md5() -> typing.Any
Creates a new MD5 hash object. Call update(data) to feed bytes or strings into the hash, then digest() for raw bytes or hexdigest() for the hex-encoded string.

Examples

load("@std//hash.axl", "md5")
h = md5()
h.update("hello world")
h.hexdigest()  # "5eb63bbbe01eeed093cb22bb8f5acdc3"
function sha1
def sha1() -> typing.Any
Creates a new SHA-1 hash object. Call update(data) to feed bytes or strings into the hash, then digest() for raw bytes or hexdigest() for the hex-encoded string.

Examples

load("@std//hash.axl", "sha1")
h = sha1()
h.update("hello world")
h.hexdigest()  # "2aae6c35c94fcfb415dbe95f408b9ce91ee846ed"
function sha224
def sha224() -> typing.Any
Creates a new SHA-224 hash object. Call update(data) to feed bytes or strings into the hash, then digest() for raw bytes or hexdigest() for the hex-encoded string.

Examples

load("@std//hash.axl", "sha224")
h = sha224()
h.update("hello world")
h.hexdigest()  # "2f05477fc24bb4faefd86517156dafdecec45b8a..."
function sha256
def sha256() -> typing.Any
Creates a new SHA-256 hash object. Call update(data) to feed bytes or strings into the hash, then digest() for raw bytes or hexdigest() for the hex-encoded string.

Examples

load("@std//hash.axl", "sha256")
h = sha256()
h.update("hello world")
h.hexdigest()
# "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"
function sha384
def sha384() -> typing.Any
Creates a new SHA-384 hash object. Call update(data) to feed bytes or strings into the hash, then digest() for raw bytes or hexdigest() for the hex-encoded string.

Examples

load("@std//hash.axl", "sha384")
h = sha384()
h.update("hello world")
h.hexdigest()  # 96-char hex string
function sha512
def sha512() -> typing.Any
Creates a new SHA-512 hash object. Call update(data) to feed bytes or strings into the hash, then digest() for raw bytes or hexdigest() for the hex-encoded string.

Examples

load("@std//hash.axl", "sha512")
h = sha512()
h.update("hello ")
h.update("world")
h.hexdigest()  # 128-char hex string
function blake2b
def blake2b() -> typing.Any
Creates a new BLAKE2b-512 hash object. Call update(data) to feed bytes or strings into the hash, then digest() for raw bytes or hexdigest() for the hex-encoded string.

Examples

load("@std//hash.axl", "blake2b")
h = blake2b()
h.update("hello world")
h.digest()  # raw 64-byte digest as bytes
function blake2s
def blake2s() -> typing.Any
Creates a new BLAKE2s-256 hash object. Call update(data) to feed bytes or strings into the hash, then digest() for raw bytes or hexdigest() for the hex-encoded string.

Examples

load("@std//hash.axl", "blake2s")
h = blake2s()
h.update("hello world")
h.digest()  # raw 32-byte digest as bytes