array-buffer-from-string

Create an ArrayBuffer with the [raw bytes][javascript-encoding] from a String.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
array-buffer-from-string
000.1.06 years ago6 years agoMinified + gzip package size for array-buffer-from-string in KB

Readme

ArrayBuffer from String
Create an ArrayBuffer with the raw bytesjavascript-encoding 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 bytesjavascript-encoding from a String.

See also

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