Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

hex-to-array-buffer

LinusU12kMIT2.0.0TypeScript support: included

Turn a string of hexadecimal characters into an ArrayBuffer.

ArrayBuffer, conversion, hex, hexadecimal, string

readme

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