zk-merkle-tree icon indicating copy to clipboard operation
zk-merkle-tree copied to clipboard

If a hashFn returns an odd length string, the buffer removes the last digit

Open Matan-Fridman opened this issue 11 months ago • 4 comments

My hash fn sometimes returns odd length strings and returns them as the hash of two leaves. Then behind the scenes this string probably gets turned to a buffer before it gets sent to the fn again. The problem is that a buffer from a hex string needs to be even in order to remain untouched. If its odd length it will remove the last digit. Is there a solution?

Matan-Fridman avatar Mar 25 '24 19:03 Matan-Fridman