TypedArray utility functions.
npm install uupaa.typedarray.js
TypedArray utility functions.
This module made of WebModule.
``js
TypedArray.BIG_ENDIAN // -> false (ARM, Intel CPU)
TypedArray.hton16( new Uint8Array([1,2]) ) // -> [2, 1]
TypedArray.ntoh16( new Uint8Array([1,2]) ) // -> [2, 1]
TypedArray.hton16( TypedArray.ntoh16( new Uint8Array([1,2]) ) ) // -> [1, 2]
TypedArray.expand( new Uint32Array([1,2,3]) ) // -> Uint32Array([1,2,3,0,0,0])
TypedArray.concat(new Uint8Array(10), new Uint8Array(20)) // -> new Uint8Array(30)
TypedArray.toString( new Uint8Array([0x33, 0x34, 0x35, 0x36]) ) // -> "3456"
TypedArray.fromString("Hello") // -> [72, 101, 108, 108, 111]
TypedArray.fromString("あいう") // -> [66, 68, 70]
TypedArray.fromString("あいう", Uint16Array) // -> [12354, 12356, 12358]
`
`js
importScripts("
importScripts("
`
`js
require("
require("
``