Closed bettybao1209 closed 2 years ago
it should be even yes
it should be even yes
so I tried to sign the message, of which the length of serializedTransaction
is odd while it can still output the result. Do you know why?
because it is your responsibility that message is a valid hex string and Buffer.from
(used here) oddly enough doesn't care if the input is odd or even and just drops 1 character to make it even
Here we invoke the sign
method, it will call sha256
which use hexEncoding.parse(hex)
first the get thewordArray
, can the hexEncoding.parse
method take the odd length of the hex string?
It is possible to introduce an odd-length string if parameterHexString.length
is larger than 0xff
since the code only pads up to length of 2.
https://github.com/CityOfZion/neon-js/blob/804b20a34872be3d6ae70bc036bdf367fc50b280/packages/neon-core/src/u/basic/curve.ts#L32 Hi, I'd like to know the length of parameter
message
should be even number, right?