Functional Weave
Code in TypeScript

Results for “crypto”

31 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
crypto.hmac-sha1
HMAC-SHA1 of a message under a secret key (RFC 2104, RFC 2202), the MAC under HOTP and TOTP codes.
hmacSha1 in TypeScript
crypto.sha1
The SHA-1 digest of a byte string (FIPS 180-4), for HMAC-SHA1 in HOTP/TOTP codes; not for new signatures.
sha1 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
auth.recovery-codes
Two-factor recovery codes: generate from caller entropy, hash for storage, and verify-and-consume as a pure step.
A group of 4: generateRecoveryCodes, normaliseRecoveryCode, hashRecoveryCode, consumeRecoveryCode
auth.totp
Authenticator-app two-factor codes (TOTP RFC 6238, HOTP RFC 4226): secret, QR URI, codes, verify with window and drift.
A group of 5: totpSecret, totpUri, hotpCode, totpCode, verifyTotp
encoding.hex
Bytes to lowercase hexadecimal text and back (RFC 4648 base16), strictly, identically in every language.
A group of 2: hexEncode, hexDecode
payments.stripe-checkout Integration · does I/O TypeScript only
Start a Stripe Checkout session and verify Stripe's signed webhooks, with a local stand-in for development.
A group of 3: createCheckoutSession, verifyWebhook, signWebhook
auth.oauth-sign-in Integration · does I/O TypeScript only
Sign users in with OpenID Connect or GitHub (authorisation code + PKCE), and keep them in a signed session cookie.
A group of 5: beginSignIn, completeSignIn, createSession, readSession, sessionCookie
storage.signed-url Integration · does I/O TypeScript only
Signed URLs for a browser to upload a file straight to S3 or Google Cloud Storage, and to download it.
A group of 2: signUpload, signDownload
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
react.form.money-field React ^19 · TypeScript only
A money input with its currency symbol, locale separators and min/max, read and checked by form.money-input.
MoneyField in TypeScript
money.add
Add, subtract and negate monetary amounts, refusing to mix currencies.
addMoney in TypeScript
math.clamp
Clamp an integer to an inclusive range, refusing a range whose bounds are the wrong way round.
clamp in TypeScript
math.big-integer
Exact integer arithmetic of any size, on decimal strings, for powers and products that overflow 64 bits.
calculateBigInteger in TypeScript