crypt.hash
Computes a digest and returns lowercase hexadecimal text.
Syntax
crypt.hash(data: string, algorithm: string) -> string
Parameters
| Parameter | Type | Description |
|---|---|---|
data | string | Input bytes. |
algorithm | string | Supported digest name, for example sha256. |
Returns
| Type | Description |
|---|---|
string | Hexadecimal 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
- MD5 and SHA-1 are provided for compatibility, not for new security-sensitive designs.
These are Game executor contracts. Check build requirements and session lifetimes before using them.
