hz-zhhq-web/node_modules/btoa
zzyuan f626f57dea 前端提交 2025-02-25 13:43:48 +08:00
..
bin 前端提交 2025-02-25 13:43:48 +08:00
LICENSE 前端提交 2025-02-25 13:43:48 +08:00
LICENSE.DOCS 前端提交 2025-02-25 13:43:48 +08:00
README.md 前端提交 2025-02-25 13:43:48 +08:00
index.js 前端提交 2025-02-25 13:43:48 +08:00
package.json 前端提交 2025-02-25 13:43:48 +08:00
test.js 前端提交 2025-02-25 13:43:48 +08:00

README.md

btoa

| atob | btoa | unibabel.js | Sponsored by ppl

A port of the browser's btoa function.

Uses Buffer to emulate the exact functionality of the browser's btoa (except that it supports some unicode that the browser may not).

It turns binary data to base64-encoded ascii.

(function () {
  "use strict";

  var btoa = require('btoa');
  var bin = "Hello, 世界";
  var b64 = btoa(bin);

  console.log(b64); // "SGVsbG8sIBZM"
}());

Note: Unicode may or may not be handled incorrectly. This module is intended to provide exact compatibility with the browser.

Copyright and License

Code copyright 2012-2018 AJ ONeal

Dual-licensed MIT and Apache-2.0

Docs copyright 2012-2018 AJ ONeal

Docs released under Creative Commons.