Functional Weave
Code in Python

Results for “encoding”

50 capabilities

encoding.utf8 → utf8Encode
Text to UTF-8 bytes and strictly back (RFC 3629), so hashing and signing see the same bytes in every language.
utf8_encode in Python, one function of this group
crypto.sha256
The SHA-256 digest of a byte string (FIPS 180-4), in pure code that also runs in the browser.
sha256 in Python
auth.jwt
Sign, verify and decode HS256 JSON Web Tokens (RFC 7519): signature, algorithm and exp/nbf/iat checked with leeway.
A group of 3: sign_jwt, verify_jwt, decode_jwt
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: hash_password, verify_password, password_needs_rehash
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 Python
logistics.sscc
Build an 18-digit SSCC pallet label number from extension digit, GS1 company prefix and serial, with its check digit.
build_sscc in Python
charts.color
Hex colours to RGB and back, and sRGB channels to linear light and back, identically in every language.
A group of 4: parse_hex, to_hex, srgb_to_linear, linear_to_srgb
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: totp_secret, totp_uri, hotp_code, totp_code, verify_totp
crypto.hmac-sha1
HMAC-SHA1 of a message under a secret key (RFC 2104, RFC 2202), the MAC under HOTP and TOTP codes.
hmac_sha1 in Python
todo.export-csv
Write todos as a CSV file (RFC 4180) with one column per field, for backups, spreadsheets and other apps.
export_csv in Python
text.initials
Initials from a personal name for avatars and signatures: "Jean-Paul Sartre" is "JPS".
initials in Python
text.slugify
Turn a title into a lowercase ASCII URL slug, transliterating common accented Latin letters.
slugify in Python
text.mask
Mask all but the last n characters of a card, account or phone number, optionally keeping separators.
mask in Python
net.ip-classify
Classify an IPv4 or IPv6 address as loopback, private, link-local, multicast, documentation, CGNAT or global.
classify_ip in Python
net.mac-address
Validate a MAC address in colon, hyphen, Cisco dot or bare form and normalise it, with multicast and local bits.
validate_mac_address in Python