tc39 / proposal-arraybuffer-base64

TC39 proposal for Uint8Array<->base64/hex
https://tc39.github.io/proposal-arraybuffer-base64/
MIT License
248 stars 8 forks source link

[spec] `FromHex`: refactor #46

Closed ljharb closed 8 months ago

ljharb commented 8 months ago

this matches what you did in your polyfill anyways, and makes the algorithm cleaner imo.

If having "the length of bytes" in there is weird, then my fallback would be, changing the return in step 6.f.i to set index = length so the return point isn't repeated, but that's a lot more subjective of an improvement to be fair.