Open
Description
The current implementation stores the hashes as hexadecimal strings and computes parent hashes doing something like this:
parentHashHex = hash(new Buffer(leftHex + rightHex, 'hex')).toString('hex')
I'm not sure if this is a standard, but it means that the parent hash is encoding dependent.
To me, it makes more sense to use buffers and concatenate the binary data directly:
parentHashBuf = hash(Buffer.concat([leftBuf, rightBuf]))
This way, the computation does not rely on encoding. Since it decouples encoding, it also makes it possible to use other encodings such as base64 and still get the same parent hashes.
Metadata
Metadata
Assignees
Labels
No labels