Repository navigation
ox@1.1.0
Minor Changes
-
#321
3e5c27bThanks @jxom! - Addedox/nodefor native SHA-256, RIPEMD-160, and HMAC-SHA256, andox/wasmfor those hashes plus WASM-backed Keccak256.import { Engine } from "ox/wasm"; await Engine.load();
-
#321
3e5c27bThanks @jxom! - AddedEngine, which swaps ox's cryptography for another implementation across theBls,Ed25519,Hash,Keystore,Mnemonic,P256,Secp256k1andX25519slots.
Patch Changes
-
#319
96bd9ceThanks @jxom! - FixedHex.toBytessilently accepting characters aboveU+00FF, and sped up decoding of short values and encoding on runtimes withoutUint8Array.prototype.toHex.Buffer.from(…, 'hex')masks each UTF-16 code unit to 8 bits, so a character
aboveU+00FFcould alias a hex digit rather than being rejected:Hex.toBytes("0x숰0"); // before: Uint8Array [0] (U+C230 masked to the digit `0`) // after: throws Hex.InvalidHexValueError
-
#321
3e5c27bThanks @jxom! - FixedVirtualMaster.mineSaltAsyncaccepting non-positive, non-finite, non-integer or larger-than-uint32 chunk sizes. -
#319
96bd9ceThanks @jxom! - FixedBase64.fromBytesdouble-padding URL-safe output, andBase64.toBytessilently accepting characters aboveU+00FF.omitPaddinggoverns both alphabets, so padding was appended to an
already-paddedbase64urlstring on every runtime with
Uint8Array.prototype.toBase64— browsers and Bun, but not Node:Base64.fromBytes(Bytes.from([0xfa]), { url: true, pad: true }); // before: '-g====' // after: '-g=='
Separately, the decoder's alphabet table only spans Latin-1, so a character
above it read asundefinedand decoded asArather than being refused:Base64.toBytes("숰GVsbG8="); // before: Uint8Array of "\u0000ello" // after: throws Base64.InvalidCharacterError