Tea — a strongly typed scripting language
Tea
DocsPlaygroundExamplesReferenceCommunity
GitHub

Tea Language

A strongly typed scripting language for native tools.

© 2026 Tea Language.

Agent documentationContributingCommunityRepository

Language Runtime

Built-ins

Standard Library

std.argsstd.assertstd.audiostd.encodingstd.envstd.fsstd.hashstd.httpstd.netstd.jsonstd.mathstd.parsestd.pathstd.processstd.randomstd.raylibstd.regexstd.stringstd.timestd.url

Read as Markdown

Standard Library

std.hash

Digests and checksums: SHA-256/512, HMAC-SHA256, CRC32, and FNV-1a.

Exported functions

pub def sha256(text: String) -> String

Compute the SHA-256 digest of UTF-8 text as lowercase hex.

Examples

use hash from "std.hash"

@println(hash.sha256("hello"))
# 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
pub def sha256_bytes(data: List[Int]) -> List[Int]

Compute the SHA-256 digest of bytes.

Examples

use hash from "std.hash"
use encoding from "std.encoding"

const digest = hash.sha256_bytes([104, 101, 108, 108, 111])
@println(encoding.hex_encode(digest) == hash.sha256("hello")) # true
pub def sha512(text: String) -> String

Compute the SHA-512 digest of UTF-8 text as lowercase hex.

pub def sha512_bytes(data: List[Int]) -> List[Int]

Compute the SHA-512 digest of bytes.

pub def hmac_sha256(key: String, message: String) -> String

Compute an HMAC-SHA256 tag over UTF-8 text as lowercase hex.

Examples

use hash from "std.hash"

const tag = hash.hmac_sha256("example-key", "message")
@println(@len(tag)) # 64 hexadecimal characters
pub def hmac_sha256_bytes(key: List[Int], message: List[Int]) -> List[Int]

Compute an HMAC-SHA256 tag over bytes.

pub def crc32(text: String) -> Int

Compute the CRC32 checksum of UTF-8 text.

Examples

use hash from "std.hash"

@println(hash.crc32("123456789")) # 3421780262
pub def crc32_bytes(data: List[Int]) -> Int

Compute the CRC32 checksum of bytes.

pub def fnv1a64(text: String) -> Int

Compute the FNV-1a 64-bit hash of UTF-8 text.

pub def fnv1a64_bytes(data: List[Int]) -> Int

Compute the FNV-1a 64-bit hash of bytes.