array-buffer-from-string

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

MIT 1 个版本
安装
npm install array-buffer-from-string
yarn add array-buffer-from-string
pnpm add array-buffer-from-string
bun add array-buffer-from-string
README

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

版本列表
0.1.0 2016-08-15