1.0.5 ā¢ Published 3 years ago
@esbiya/base64-wasm v1.0.5
a base64 lib for customize table
š Homepage
Usage
(async () => {
let base64 = await require("@esbiya/base64-wasm")
const atob = require('atob')
const originString = atob("m/s+kDHLfcjVY44KyDnhkpFqo5E3xhJzD5yYOdAeAz8ANpK8OxAEoZQFWTYd3JkZhbEDddtDcy0xpPbeYDMDgTOilWpwp9+9fjKPaiOpauC/bXPzcQbflxyyGf0GVFwI2XjXE9D6a838KaCFIrsO/E1MlTv6bKszr0nazX4o7zMhpoazmvcBW6hJBCkv6TfaylQYmgQqU6jQpNTaw4MPuM8OdNDFtHHzTm/mrvRsxzcxD8QpNvlquA9bRRUYKPWugw+05dwmTAWii5afFnPrvg==")
const encodeString = "M/S~KdhlFCIvy44kYdNHKPfQO5e3XHiZd5YyoDaEaZ8anPk8oXaeOzqfwtyD3iKzHBedDDTdCY0XPpBEydmdGtoJLwPWP9~9FIkpAJoPAUc/BxpZCqBFLXYYgF0gvfWj2xIxe9d6A838kAcfjRSo/e1mLtV6BkSZR0NAZx4O7ZmHPOAZMVCbw6HibcKV6tFAYLqyMGqQu6IqPntAW4mpUm8oDndfThhZtM/MRVrSXZCXd8qPnVLQUa9BrruykpwUGW~05DWMtawJJ5AFfNpRVG=="
const testMap = "abcdefghjiklmnopqrstuvwxyzABCDEFGHJIKLMNOPQRSTUVWXYZ0123456789~/="
let cipherText = base64.encode(originString, testMap)
console.log(cipherText)
console.log(cipherText == encodeString)
let plainText = base64.decode(cipherText, testMap)
console.log(plainText)
console.log(plainText == originString)
})()
Compile
em++ -O3 -s WASM=1 -s EXPORTED_FUNCTIONS="['_free', '_malloc']" --no-entry -o ./build/base64.js ./src/base64.cc
Author
š¤ esbiya
- Github: @Esbiya
š¤ Contributing
Contributions, issues and feature requests are welcome!Feel free to check issues page. You can also take a look at the contributing guide.
Show your support
Give a āļø if this project helped you!
š License
Copyright Ā© 2021 esbiya. This project is MIT licensed.
This README was generated with ā¤ļø by readme-md-generator