bitcore icon indicating copy to clipboard operation
bitcore copied to clipboard

hexToBuffer accept empty string

Open isghe opened this issue 4 years ago • 1 comments

So it's possible to:

bitcore.util.buffer.hexToBuffer('').toString('hex');

that produce an empty string as expected, instead od an assertion error.

This commit makes https://github.com/bitpay/bitcore/pull/3181 unnecessary.

isghe avatar Jun 02 '21 14:06 isghe

and make it possible to:

bitcore.crypto.Hash.sha256 (bitcore.util.buffer.hexToBuffer('')).toString ('hex');

that produce "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" as expected, instead of an assertion error.

isghe avatar Jun 02 '21 14:06 isghe