https://github.com/frsource/base64
base64 encoder/decoder with UTF-8 support 📔
https://github.com/frsource/base64
base64 base64-decoding base64-encoding decoding encoder encoder-decoder encoding utf-8 webtoolkit
Last synced: 9 months ago
JSON representation
base64 encoder/decoder with UTF-8 support 📔
- Host: GitHub
- URL: https://github.com/frsource/base64
- Owner: FRSOURCE
- License: mit
- Created: 2022-09-23T21:04:00.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T12:00:13.000Z (about 1 year ago)
- Last Synced: 2024-10-29T13:36:58.653Z (about 1 year ago)
- Topics: base64, base64-decoding, base64-encoding, decoding, encoder, encoder-decoder, encoding, utf-8, webtoolkit
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/@frsource/base64
- Size: 761 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @frsource/base64
This javascript code is used to encode / decode data using base64 (this encoding is designed to make binary data survive transport through transport layers that are not 8-bit clean). Script is fully compatible with UTF-8 encoding. You can use base64 encoded data as simple encryption mechanism.
If you plan using UTF-8 encoding in your project don’t forget to set the page encoding to UTF-8 (Content-Type meta tag).
## Installation
```bash
npm i @frsource/base64
```
## Usage
```js
// Importing:
// typescript / ES6
import { encode, decode } from '@frsource/base64';
// legacy javscript
const { encode, decode } = require('@frsource/base64');
const encoded = encode('我喜欢解码lubię dekodować');
console.log(encoded); // output: 5oiR5Zac5qyi6Kej56CBbHViacSZIGRla29kb3dhxIc=
const decoded = decode(encoded);
console.log(encoded); // output: 我喜欢解码lubię dekodować
```
## References
Based on webtoolkit.info implementation.
Original source code available at: http://www.webtoolkit.info/javascript_base64.html
## License
[MIT](https://opensource.org/licenses/MIT)
Copyright (c) 2022-present, Jakub FRS Freisler, [FRSOURCE](https://www.frsource.org/)