Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Provide support for byte array as an argument for bytesToBuffer #35

Open
signumcode opened this issue Sep 17, 2018 · 0 comments
Open

Provide support for byte array as an argument for bytesToBuffer #35

signumcode opened this issue Sep 17, 2018 · 0 comments

Comments

@signumcode
Copy link

signumcode commented Sep 17, 2018

function bytesToBuffer(value) {
if (Buffer.isBuffer(value)) {
return value
}
if (isHex0x(value)) {
return Buffer.from(value.slice(2), 'hex')
}
if (isHex(value)) {
return Buffer.from(value, 'hex')
}
throw new Error('Expected byte representation (buffer, hex0x or hex): could not convert provided type')
}

May we add support of byte array as an argument for bytesToBuffer function?

@signumcode signumcode changed the title Provide support for number number array. Provide support for array of numbers as an argument for bytesToBuffer Sep 17, 2018
@signumcode signumcode changed the title Provide support for array of numbers as an argument for bytesToBuffer Provide support for array of numbers as an argument for bytesToBuffer Sep 17, 2018
@signumcode signumcode changed the title Provide support for array of numbers as an argument for bytesToBuffer Provide support for byte array as an argument for bytesToBuffer Sep 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants