2.5.1 • Published 3 years ago

as-bitray v2.5.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Bitray

A Small Utility For Handling Binary Data Written In AssemblyScript

About

  • AssemblyScript Compatible
  • Small And Fast
  • Works In Browser And Node
  • Zero Dependencies

Installation

~ npm install as-bitray --save

Usage

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...

Encodings

Binray Supports The Following Encodings:

  • Utf-8
  • Base64
  • Hex
  • 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 Encode

Decode Performance Decode

Notes

  • Does not accept Array/Uint8Array as input

As always, please star on GitHub! 😊

2.4.9

3 years ago

2.5.0

3 years ago

2.5.1

3 years ago

2.4.7

3 years ago

2.4.8

3 years ago

2.4.6

3 years ago

2.4.5

3 years ago

2.4.4

3 years ago

2.4.3

3 years ago

2.4.1

3 years ago

2.4.0

3 years ago