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

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

@signumcode

Description

@signumcode

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions