ReferenceEncoding and crypto

crypt.hash

Computes a digest and returns lowercase hexadecimal text.

Syntax

crypt.hash(data: string, algorithm: string) -> string

Parameters

ParameterTypeDescription
datastringInput bytes.
algorithmstringSupported digest name, for example sha256.

Returns

TypeDescription
stringHexadecimal digest.

Description

Supported names include sha256, sha384, sha512, sha1 and md5; name matching ignores case, hyphens and underscores. A hash is not keyed authentication. Use crypt.hmac when both sides must verify knowledge of a secret.

Example

print(crypt.hash("hello", "sha256"))

Notes

These are Game executor contracts. Check build requirements and session lifetimes before using them.