Bytes.concat | (...arrays: BytesType[]) => BytesType | Join multiple byte arrays into a single buffer |
Bytes.slice | (bytes: BytesType, start?: number, end?: number) => BytesType | Byte range slice |
Bytes.padLeft | (bytes: BytesType, size: number) => BytesType | Left-pad with 0x00 to size bytes |
Bytes.padRight | (bytes: BytesType, size: number) => BytesType | Right-pad with 0x00 to size bytes |
Bytes.trimLeft | (bytes: BytesType) => BytesType | Strip leading 0x00 bytes |
Bytes.trimRight | (bytes: BytesType) => BytesType | Strip trailing 0x00 bytes |
Bytes.size | (bytes: BytesType) => number | Byte length |
Bytes.isEmpty | (bytes: BytesType) => boolean | True if bytes.length === 0 |
Bytes.isBytes | (value: unknown) => value is BytesType | Type guard checking Uint8Array |
Bytes.assert | (value: unknown) => void | Throw if not valid BytesType |
Bytes.equals | (a: BytesType, b: BytesType) => boolean | Byte-wise equality |
Bytes.compare | (a: BytesType, b: BytesType) => number | Lexicographic comparison (-1, 0, 1) |
Bytes.clone | (bytes: BytesType) => BytesType | Copy into an independent Uint8Array |