https://github.com/consento-org/base32-codecs
codecs compatible base32-encode and base32-decode adapter.
https://github.com/consento-org/base32-codecs
Last synced: over 1 year ago
JSON representation
codecs compatible base32-encode and base32-decode adapter.
- Host: GitHub
- URL: https://github.com/consento-org/base32-codecs
- Owner: consento-org
- License: mit
- Created: 2020-12-15T05:43:33.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-15T10:21:28.000Z (over 5 years ago)
- Last Synced: 2024-04-22T09:15:25.829Z (over 2 years ago)
- Language: TypeScript
- Size: 14.6 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# base32-codecs
`base32-codecs` is a [codecs][codecs] compatible adapter to [base32-encode][encode] and [base32-decode][decode].
[codecs]: (https://github.com/mafintosh/codecs)
[encode]: https://github.com/LinusU/base32-encode
[decode]: https://github.com/LinusU/base32-decode
## Usage
```javascript
const {
base32, // RFC4648, unpadded
base32c, // Crockford
base32h, // RFC4648-HEX, unpadded
base32hp, // RFC4648-HEX, padded
base32p // RFC4648, Padded
} = require('base32-codecs')
for (const codec of [base32, base32c, base32h, base32hp, base32p]) {
codec.encode(
codec.decode(crypto.randomBytes(10))
)
}
```
## License
[MIT](./LICENSE)