AJ ONeal 541f141d47
Merge pull request #5 from chrisjlee/patch-1
Remove dangling semi-colon
2018-03-27 22:33:15 -06:00
2012-06-26 13:28:01 -06:00
2013-07-25 09:17:12 -07:00
2016-05-10 11:01:01 -05:00
2013-07-25 09:17:12 -07:00
2014-05-20 08:55:26 -06:00
2014-05-20 09:58:09 -05:00
2012-09-19 14:22:55 -06:00

btoa

A port of the browser's btoa function.

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

It turns binary data to base64-encoded ascii.

(function () {
  "use strict";
  
  var btoa = require('btoa')
    , bin = "Hello, 世界"
    , b64 = btoa(bin)
    ;

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

Note: Unicode may or may not be handled incorrectly.

Copyright and license

Code and documentation copyright 2012-2014 AJ ONeal Tech, LLC.

Code released under the Apache license.

Docs released under Creative Commons.

Description
btoa for Node.JS (it's a one-liner)
Readme 43 KiB
Languages
JavaScript 100%