Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hexToBuffer accept empty string #3182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

isghe
Copy link

@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
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.

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.

1 participant