npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

base32.js

v0.1.0

Published

Base 32 encodings for JavaScript

Downloads

1,596,642

Readme

Base 32 for JavaScript Build Status

Wikipedia:

Base32 is a base 32 transfer encoding using the twenty-six letters A–Z and six digits 2–7. It is primarily used to encode binary data, but is able to encode binary text like ASCII.

Base32 has number of advantages over Base64:

  1. The resulting character set is all one case (usually represented as uppercase), which can often be beneficial when using a case-insensitive filesystem, spoken language, or human memory.

  2. The result can be used as file name because it can not possibly contain '/' symbol which is usually acts as path separator in Unix-based operating systems.

  3. The alphabet was selected to avoid similar-looking pairs of different symbols, so the strings can be accurately transcribed by hand. (For example, the symbol set omits the symbols for 1, 8 and zero, since they could be confused with the letters 'I', 'B', and 'O'.)

  4. A result without padding can be included in a URL without encoding any characters.

However, Base32 representation takes roughly 20% more space than Base64.

Documentation

Full documentation at http://mikepb.github.io/base32.js/

Installation

$ npm install base32.js

Usage

Encoding an array of bytes using Crockford:

var base32 = require("base32.js");

var buf = [1, 2, 3, 4];
var encoder = new base32.Encoder({ type: "crockford", lc: true });
var str = encoder.write(buf).finalize();
// str = "04106173"

var decoder = new base32.Decoder({ type: "crockford" });
var out = decoder.write(str).finalize();
// out = [1, 2, 3, 4]

The default Base32 variant if no type is provided is "rfc4648" without padding.

Browser support

The browser versions of the library may be found under the dist/ directory. The browser files are updated on each versioned release, but not for development. Karma is used to run the mocha tests in the browser.

$ npm install -g karma-cli
$ npm run karma

Related projects

License

MIT