New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

base16384

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

base16384

Base16384 encoder and decoder

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

Base16384

downloads npm GitHub

A unicode-based encoding scheme that presents binary data (sequence of 8-bit bytes) in sequences of 14-bit printable Chinese characters. It saves 17% space compared to base64.

Inspired by fumiama/base16384.

Description

Base16384 uses 16384 (214) Chinese characters (from \u4E00 to \u8DFF) to represent binary data.

If the length of the binary data is not a multiple of 7, we will add a \u3D0x (where x is the remainder modulo 7) after the output.

Comparison

Base64Base16384
Overhead33%14%
Charset[0-9a-zA-Z+/][\u4E00-\u8DFF]
ExampleRXhhbXBsZQ==彞吖菁穥㴀

Usage

import { decode, encode } from 'base16384'

const buffer = encode('Example') // Uint16Array
new TextDecoder().decode(decode(buffer)) // 'Example'

API

encode(data)

  • data: string | Uint8Array original binary data
  • returns: Uint16Array base16384-encoded data

Encode binary data to base16384.

decode(data)

  • data: string | Uint16Array base16384-encoded data
  • returns: Uint8Array original binary data

Decode base16384 to binary data.

FAQs

Package last updated on 27 Jun 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc