Skip to content
This repository has been archived by the owner on Jan 11, 2022. It is now read-only.

Handle Uint8Array inputs #16

Merged
merged 1 commit into from
Jul 28, 2018
Merged

Handle Uint8Array inputs #16

merged 1 commit into from
Jul 28, 2018

Conversation

jacogr
Copy link
Contributor

@jacogr jacogr commented Feb 7, 2018

  • Handle Uint8Array inputs (equivalent to Buffer)
  • Expand tests to test for Array & Buffer <-> Uint8Array equivalence

@coveralls
Copy link

coveralls commented Feb 7, 2018

Coverage Status

Coverage increased (+0.9%) to 91.27% when pulling daf331c on jacogr:master into 296857a on ethereumjs:master.

index.js Outdated
@@ -221,6 +221,8 @@ function toBuffer (v) {
} else if (v.toArray) {
// converts a BN to a Buffer
v = new Buffer(v.toArray())
} else if (v instanceof Uint8Array) {
v = new Buffer(v)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Buffer.from

@axic
Copy link
Member

axic commented Feb 15, 2018

@jacogr thanks! Can you please rebase?

And would be interested adding a similar change to ethereumjs-util?

@axic axic mentioned this pull request Feb 15, 2018
@holgerd77
Copy link
Member

Hi @jacogr, would really like to close on this, do you think you could find some time to bring this over the finish-line (with a rebase and some changes regarding to the comments)?

Would be cool! 😄

@axic axic merged commit c4deaa9 into ethereumjs:master Jul 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants