# rfc-3548-b32

> Binary safe implementation of RFC 3548 Base32 encoding/decoding for node.

Latest version **0.0.2** (published 2014-06-20) · 0 weekly downloads

## Install

```sh
npm install rfc-3548-b32
pnpm add rfc-3548-b32
yarn add rfc-3548-b32
bun add rfc-3548-b32
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2014-06-20 |
| First published | 2014-06-20 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Sehrope Sarkuni |
| Maintainers | sehrope |
| Keywords | base32, encoding, rfc-3548 |

## Links

- npm: https://www.npmjs.com/package/rfc-3548-b32
- Repository: https://github.com/sehrope/node-rfc-3548-b32
- Issues: https://github.com/sehrope/node-rfc-3548-b32/issues
- npm.io page: https://npm.io/package/rfc-3548-b32

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2014-06-20

## README

# rfc-3548-b32

Implementation of [RFC-3548] Base32 encoding/decoding for node that uses [Buffers] for input/output so it's binary safe.

## Installation
    
    npm install rfc-3548-b32 --save

## Usage

    var base32 = require('rfc-3548-b32');

    // Arbitrary binary data:
    var bytes = new Buffer([1, 2, 3, 4, 5]);

    // bytes (hex): 0102030405
    console.log("bytes (hex): %s", bytes.toString('hex'));

    // Encode it as base32 string:
    var bytesAsBase32 = base32.encode(bytes);

    // bytes (b32): AEBAGBAF
    console.log("bytes (b32): %s", bytesAsBase32);

    // Decode it back to a buffer:
    var decodedBytes = base32.decode(bytesAsBase32);

    // bytes (hex): 0102030405
    console.log("bytes (hex): %s", decodedBytes.toString('hex'));

## Functions

### encode(Buffer)
Encodes the supplied Buffer in base32. Returns a String.

### decode(String)
Decodes the supplied base32 String. Returns a Buffer.

## Testing
Tests are in the ./test directory (mocha default). You can run the tests via make:

    $ make test

## Thanks
Thanks to [https://github.com/chrisumbel/thirty-two](https://github.com/chrisumbel/thirty-two) and [https://github.com/OhJeez/thirty-two](https://github.com/OhJeez/thirty-two) for the real work in writing the base32 code. This module is just a repackaged version of the latter with the encode return type changed to return a String.

[RFC-3548]: http://tools.ietf.org/html/rfc3548
[Buffers]: http://nodejs.org/api/buffer.html

---
_Source: https://npm.io/package/rfc-3548-b32 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
