Socket
Book a DemoInstallSign in
Socket

as-bitray

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

as-bitray

Bitray - Small Utility For Handling Binary Data Written In AssemblyScript

latest
Source
npmnpm
Version
2.5.1
Version published
Maintainers
1
Created
Source

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! 😊

Keywords

AssemblyScript

FAQs

Package last updated on 29 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts