Skip to content

hexToBuffer accept empty string#3182

Closed
isghe wants to merge 1 commit intobitpay:masterfrom
isghe:hexToBuffer_accept_empty_string
Closed

hexToBuffer accept empty string#3182
isghe wants to merge 1 commit intobitpay:masterfrom
isghe:hexToBuffer_accept_empty_string

Conversation

@isghe
Copy link
Copy Markdown

@isghe isghe commented Jun 2, 2021

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 #3181 unnecessary.

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 bitpay#3181 unnecessary.
@isghe isghe mentioned this pull request Jun 2, 2021
@isghe
Copy link
Copy Markdown
Author

isghe commented Jun 2, 2021

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.

@kajoseph kajoseph closed this Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants