mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-08-14 06:47:28 +00:00
fromHex validated only that the string was even-length, then used
parseInt(pair, 16) per byte. parseInt returns NaN for a non-hex pair, and a
Uint8Array stores NaN as 0 — so fromHex('zzzz') silently returned [0, 0]
instead of failing. Add a hex-charset check (allowing empty input) so bad
input throws. Add bytes.test.ts covering valid decode, round-trip, odd-length
and non-hex cases.
|
||
|---|---|---|
| .. | ||
| verify | ||
| bytes.test.ts | ||
| bytes.ts | ||
| cbor.test.ts | ||
| cbor.ts | ||
| client.test.ts | ||
| client.ts | ||
| index.ts | ||
| name.test.ts | ||
| name.ts | ||
| types.ts | ||