https://github.com/linusu/base32-decode
Base32 decoder with support for multiple variants
https://github.com/linusu/base32-decode
Last synced: about 1 year ago
JSON representation
Base32 decoder with support for multiple variants
- Host: GitHub
- URL: https://github.com/linusu/base32-decode
- Owner: LinusU
- Created: 2016-08-21T21:55:43.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2021-12-14T09:49:52.000Z (over 4 years ago)
- Last Synced: 2024-04-29T12:43:18.157Z (about 2 years ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 9
- Watchers: 4
- Forks: 4
- Open Issues: 9
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Base32 Decode
Base32 decoder with support for multiple variants.
## Installation
```sh
npm install --save base32-decode
```
## Usage
```js
const base32Decode = require('base32-decode')
console.log(base32Decode('EHJQ6X0', 'Crockford'))
//=> ArrayBuffer { 4 }
console.log(base32Decode('ORSXG5A=', 'RFC4648'))
//=> ArrayBuffer { 4 }
console.log(base32Decode('EHIN6T0=', 'RFC4648-HEX'))
//=> ArrayBuffer { 4 }
```
## API
### base32Decode(input, variant)
- `input` <String>
- `variant` <String>
- Return: <ArrayBuffer> The decoded raw data
Decode the data in `input`. `variant` should be one of the supported variants
listed below.
- `'RFC3548'` - Alias for `'RFC4648'`
- `'RFC4648'` - [Base32 from RFC4648](https://tools.ietf.org/html/rfc4648)
- `'RFC4648-HEX'` - [base32hex from RFC4648](https://tools.ietf.org/html/rfc4648)
- `'Crockford'` - [Crockford's Base32](http://www.crockford.com/wrmg/base32.html)
## See also
- [base32-encode](https://github.com/LinusU/base32-encode) - Base32 encoder