https://github.com/path-check/base32-url-js
Very simple Base32 encoder without padding.
https://github.com/path-check/base32-url-js
base32 encoding
Last synced: over 1 year ago
JSON representation
Very simple Base32 encoder without padding.
- Host: GitHub
- URL: https://github.com/path-check/base32-url-js
- Owner: Path-Check
- License: gpl-3.0
- Created: 2021-05-19T21:18:17.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-11T21:27:04.000Z (about 5 years ago)
- Last Synced: 2025-02-12T14:59:45.436Z (over 1 year ago)
- Topics: base32, encoding
- Language: JavaScript
- Size: 401 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# base32-url-js
Very simple extension to hi-base32 to encode/decode using URL-safe characters. Same idea of Base64URL, thus Base32URL.
## Installation
Use this command to install:
npm install base32url
## Usage
You could use like this:
If you use node.js, you should require the module first:
```js
const Base32URL = require('base32url');
```
or import it
```js
import * as Base32URL from 'base32url';
```
And then just call the functions when needed:
```js
Base32URL.encode('String to encode');
Base32URL.decode([]]);
```
### Methods
#### Base32URL.encode(input)
Encode string or bytes to base32url, set asciiOnly to true for better performace if it is.
##### *input: `String`, `Array`, `Uint8Array` or `ArrayBuffer`*
Input string or bytes to encode.
#### Base32URL.decode(base32Str)
Decode Base32URL string and return a *`byte array`*
##### *base32Str: `String`*
Base32URL string to decode.
#### Base32URL.decodeAsString(base32Str)
Decode Base32URL string and return a *`string`*
##### *base32Str: `String`*
Base32URL string to decode.