New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

basenone

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

basenone

Encode Uint8Array to strings and back.

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

BaseNone is a simple dependency free library to encode Uint8Array to strings and back.

BaseNone should work in any modern browser, compliant javascript runtimes and Node.js.

Installation

npm install basenone

Constructor

import BaseNone from 'basenone'

const baseNone = new BaseNone(Uint8Array)

Ascii

// static method
const baseNone = BaseNone.fromAscii('My ascii string');

// raw Uint8Array
const raw = baseNone.getRaw();

// BaseNone to ascii
const ascii: string = baseNone.toAscii();

Binary

// static method
const baseNone = BaseNone.fromBinary('0100100001100101011011000110110001101111');

// raw Uint8Array
const raw = baseNone.getRaw();

// BaseNone to binary
const binary: string = baseNone.toBinary();

Base 16 (Hex)

// static method
const baseNone = BaseNone.fromHex('48656c6c6f2c20576f726c6421');

// raw Uint8Array
const raw = baseNone.getRaw();

// BaseNone to hex
const hex: string = baseNone.toHex();

base64

// static method
const baseNone = BaseNone.fromBase64('SGVsbG8sIFdvcmxkIQ==');

// raw Uint8Array
const raw = baseNone.getRaw();

// BaseNone to base64
const base64: string = baseNone.toBase64();

UTF-8

// static method
const baseNone = BaseNone.fromUTF8('你好世界');

// raw Uint8Array
const raw = baseNone.getRaw();

// BaseNone to utf8
const utf8: string = baseNone.toUTF8();

In Progress

  • Base 32
  • Base 62

Keywords

encode

FAQs

Package last updated on 21 Mar 2023

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