Functional Weave
Code in TypeScript

Results for “crypto”

22 capabilities

crypto.sha256
The SHA-256 digest of a byte string (FIPS 180-4), in pure code that also runs in the browser.
sha256 in TypeScript
encoding.utf8
Text to UTF-8 bytes and strictly back (RFC 3629), so hashing and signing see the same bytes in every language.
A group of 2: utf8Encode, utf8Decode
auth.password-hash
Hash a password for storage as pbkdf2_sha256$iterations$salt$hash, verify one in constant time, and spot weak hashes.
A group of 3: hashPassword, verifyPassword, passwordNeedsRehash
encoding.hex
Bytes to lowercase hexadecimal text and back (RFC 4648 base16), strictly, identically in every language.
A group of 2: hexEncode, hexDecode
math.pow
base to the power exponent from + - * / only, exact by squaring for whole exponents, identical in every language.
pow in TypeScript
math.exp
e to the power x from + - * / only, so TypeScript, Python and Rust return the same double for the same input.
exp in TypeScript
money.compare
Compare two amounts of one currency, refusing to compare across currencies; min, max and clamp too.
A group of 4: compareMoney, minMoney, maxMoney, clampMoney
math.clamp
Clamp an integer to an inclusive range, refusing a range whose bounds are the wrong way round.
clamp in TypeScript