You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
typesetting/pitfall/pdfkit/node_modules/Base64
Matthew Butterick 3f36e2ce2c porting 7 years ago
..
test porting 7 years ago
.npmignore porting 7 years ago
.travis.yml porting 7 years ago
LICENSE porting 7 years ago
Makefile porting 7 years ago
README.md porting 7 years ago
base64.js porting 7 years ago
base64.min.js porting 7 years ago
package.json porting 7 years ago

README.md

Base64.js

≈ 500 byte* polyfill for browsers which don't provide window.btoa and window.atob.

Although the script does no harm in browsers which do provide these functions, a conditional script loader such as yepnope can prevent unnecessary HTTP requests.

yepnope({
  test: window.btoa && window.atob,
  nope: 'base64.js',
  callback: function () {
    // `btoa` and `atob` are now safe to use
  }
})

Base64.js stems from a gist by yahiko.

Running the test suite

make setup
make test

* Minified and gzipped. Run make bytes to verify.