0.1.0 • Published 8 years ago

array-buffer-from-string v0.1.0

Weekly downloads
6,820
License
MIT
Repository
github
Last release
8 years ago

ArrayBuffer from String

Create an ArrayBuffer with the raw bytes from a String.

Installation

npm install --save array-buffer-from-string

Usage

const arrayBufferFromString = require('array-buffer-from-string')

console.log(arrayBufferFromString('Hello world!'))
//=> ArrayBuffer { byteLength: 24 }

API

arrayBufferFromString(input: string) => ArrayBuffer

Create an ArrayBuffer with the raw bytes from a String.

See also

hex-to-array-buffer - Turn a string of hexadecimal characters into an ArrayBuffer