hex-to-array-buffer
Version:
Turn a string of hexadecimal characters into an `ArrayBuffer`.
28 lines (17 loc) • 553 B
Markdown
Turn a string of hexadecimal characters into an `ArrayBuffer`.
```sh
npm install --save hex-to-array-buffer
```
```js
import hexToArrayBuffer from 'hex-to-array-buffer'
const buffer = hexToArrayBuffer('ceae96a325e1dc5dd4f405d905049ceb')
console.log(buffer)
//=> ArrayBuffer { byteLength: 16 }
```
- `input` (`string`, required) - specified as a string of hexadecimal characters
- returns `ArrayBuffer` - a new ArrayBuffer with the binary content from `input`