View all results

Crypto

Functions for hashing, encoding, and generating secure values.

crypto::md5

1-parameter signature

crypto::md5(value)

md5 computes the MD5 digest of raw bytes. Strings supply their UTF-8 bytes. This legacy digest is unsuitable for security-sensitive collision resistance.

Parameters
  • valueString | BinaryThe input data.
Returns
StringThe lowercase hexadecimal digest.

crypto::random_token

1-parameter signature

crypto::random_token(length)

random_token generates a cryptographically secure token with uniformly sampled lowercase letters, uppercase letters, and digits.

Parameters
  • lengthIntToken length, from 1 through 65536 inclusive.
Returns
StringThe generated token. Entropy-source errors are propagated.

crypto::sha1

1-parameter signature

crypto::sha1(value)

sha1 computes the SHA1 digest of raw bytes. Strings supply their UTF-8 bytes. This legacy digest is unsuitable for security-sensitive collision resistance.

Parameters
  • valueString | BinaryThe input data.
Returns
StringThe lowercase hexadecimal digest.

crypto::sha256

1-parameter signature

crypto::sha256(value)

sha256 computes the SHA256 digest of raw bytes. Strings supply their UTF-8 bytes.

Parameters
  • valueString | BinaryThe input data.
Returns
StringThe lowercase hexadecimal digest.

crypto::sha512

1-parameter signature

crypto::sha512(value)

sha512 computes the SHA512 digest of raw bytes. Strings supply their UTF-8 bytes.

Parameters
  • valueString | BinaryThe input data.
Returns
StringThe lowercase hexadecimal digest.