This repository was archived by the owner on Oct 28, 2025. It is now read-only.

Description
Hi,
I'm playing with this new api, and I thing it could be great to have an offset argument on the setFromBase64/Hex methods:
Issue: on mdn
const uint8Array = new Uint8Array(8);
// Start writing at offset 2
const result = uint8Array.subarray(2).setFromHex("cafed00d");
In my opinion, this feels sub-optimal.
Proposal:
We could mimic the .set method.
interface Uint8Array {
setFromHex(input: string, offset?: number): { read: number; written: number; };
}
const uint8Array = new Uint8Array(8);
uint8Array.setFromHex("cafed00d", 2);
What do you think ?