@esbiya/base64-wasm

1.0.5 • Public • Published

Welcome to base64-wasm 👋

Version Documentation Maintenance License: MIT

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

🤝 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

Readme

Keywords

Package Sidebar

Install

npm i @esbiya/base64-wasm

Weekly Downloads

0

Version

1.0.5

License

MIT

Unpacked Size

106 kB

Total Files

8

Last publish

Collaborators

  • esbiya