A Small Utility For Handling Binary Data Written In AssemblyScript
- AssemblyScript Compatible
- Small And Fast
- Works In Browser And Node
- Zero Dependencies
~ npm install as-bitray --save
Basic Usage
import { Bitray } from 'as-bitray'
const bit = new Bitray('Hello World π', 'utf8')
//=> Bitray
bit.toFormat('hex')
//==> 48656c6c...
ArrayLike to Bitray
import { Bitray } from 'as-bitray'
const bit = Bitray.from([152, 83, 34, 125])
//=> Bitray
bit.toFormat('hex')
//==> 48656c6c...
Binray Supports The Following Encodings:
- Utf-8
- Base64
- Hex
- Binary/Latin1
- Ucs2
- Utf16
Creates A New Bitray Instance. Built On Top Of Uint8Array.
Convert Bitray Into A String Encoding.
- Does not accept Array/Uint8Array as input
As always, please star on GitHub! π