Package Exports
- bitray
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bitray) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Bitray
A Small Utility For Handling Binary Data
About
- Integrates With Buffer
- Small And Fast
- Works In Browser And Node
- Zero Dependencies
Installation
~ npm install bitray --save
Usage
Basic Usage
const Bitray = require('bitray')
const bit = new Bitray('Hello World 🌎')
console.log(bit.toFormat('hex'))
Buffer Integration
const Bitray = require('bitray')
const bit = new Bitray('Hello World 🌎')
// Convert To Buffer
const buffer = Buffer.from(bit)
//===> <Buffer 68 65 6c 6c ... >
Encodings
Binray Supports The Following Encodings:
- Utf-8
- Base64
- Hex
- Base58
- Binary/Latin1
- Ucs2
- Utf16
API
new Bitray(string, format) -->> Uint8Array
Creates A New Bitray Instance. Built On Top Of Uint8Array.
.toFormat(encoding) -->> String
Convert Bitray Into A String Encoding.
Performance
Encode Performance
Decode Performance