privacy-scaling-explorations / zk-kit

A monorepo of reusable libraries for zero-knowledge technologies.
https://zkkit.pse.dev
MIT License
295 stars 80 forks source link

`hexadecimalToBuffer` does not convert hex with an odd number of characters correctly #204

Closed cedoor closed 8 months ago

cedoor commented 8 months ago

Describe the bug

hexadecimalToBuffer does not convert hexadecimal strings correctly if they contain an odd number of characters.

To Reproduce

console.log(hexadecimalToBuffer("0")) // <Buffer >
console.log(hexadecimalToBuffer("1")) // <Buffer >

Expected behavior

hexadecimalToBuffer should add a "0" if the number of characters is odd.