npm.io
2.0.0 • Published 5 years ago

hex-to-array-buffer

Licence
MIT
Version
2.0.0
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
10

hex-to-array-buffer

Turn a string of hexadecimal characters into an ArrayBuffer.

Installation

npm install --save hex-to-array-buffer

Usage

import hexToArrayBuffer from 'hex-to-array-buffer'

const buffer = hexToArrayBuffer('ceae96a325e1dc5dd4f405d905049ceb')

console.log(buffer)
//=> ArrayBuffer { byteLength: 16 }

API

hexToArrayBuffer(input)
  • input (string, required) - specified as a string of hexadecimal characters
  • returns ArrayBuffer - a new ArrayBuffer with the binary content from input

Keywords