Giter VIP home page Giter VIP logo

x-base-32's Introduction

x-base-32 NPM version Build Status Dependency Status Coverage percentage

base32 encoding and decoding that optimizes byte size based on input characters and supports unicode.

Installation

$ npm install --save x-base-32

Usage

const xBase32 = require('x-base-32');

xBase32.decode(xBase32.encode('🦁🐯🐻'));
// => 🦁🐯🐻

xBase32.encode('Lions and tigers and bears!');
// => 89hmpyvkk41gpws10ehmpesbjecg62vk441h6arbjecgg7
xBase32.encode('אריות ונמרים ודובים!');
// => bq8bt5v6xbfa0gbndw2xxf8qcvq842xbekqavmdv6xt116
xBase32.encode('الأسود والنمور والدببة!');
// => brkwh64f37j8rqg86932fj4s3che933210s4c9y8k2zh8rmca844b
xBase32.encode('獅子,老虎和熊!');
// => ged2npm7z1j0031jeaj6732qz047
xBase32.encode('Львы и тигры и медведи!');
// => bgdrk46a4p10gw0848a3h1kh08jr423g10gy8dc6j351ngt8e0445
xBase32.encode('ライオンとトラとクマ!');
// => g63mk191gn8rf6c3863431t9gd0rayc6yzw0gs
xBase32.encode('🦁🐯🐻');
// => gv0zdv0er7qe2zp1xvgxg3

// Ignores invalid symbols during decoding
xBase32.decode('gv0z-dv0e-r7qe-2zp1-xvgx-g3');
// => 🦁🐯🐻

Scheme Requirements

  • Humans can accurately transmit the symbols to other humans using a telephone.
    • Only use numeric and lowercase alpha characters: [0-9], [a-h], j, k, m, n, [p-t], [v-z]
    • Re-map certain error-prone characters when they are provided for decoding:
      i -> 1
      I -> 1
      l -> 1
      L -> 1
      o -> 0
      O -> 0
      
    • Ignore all other characters providing during decoding
  • URI :: Path safe
  • Case Insensitive File System safe
  • Support the full 21-bit Unicode character set
  • Append a check digit for validating data integrity

TODO

License

ISC © Buster Collings

x-base-32's People

Contributors

busterc avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

danro

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.