base64-js
does basic base64 encoding/decoding in pure JS.
Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data.
Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does.
With npm do:
npm install base64-js
var base64 = require('base64-js')
base64
has two exposed functions, toByteArray
and fromByteArray
, which both take a single argument.
toByteArray
- Takes a base64 string and returns a byte arrayfromByteArray
- Takes a byte array and returns a base64 stringMIT
base64-js ========= `base64-js` does basic base64 encoding/decoding in pure JS. [![build status](https://secure.travis-ci.org/beatgammit/base64-js.png)](http://travis-ci.org/beatgammit/base64-js) [![testling badge](https://ci.testling.com/beatgammit/base64-js.png)](https://ci.testling.com/beatgammit/base64-js) Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data. Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does. ## install With [npm](https://npmjs.org) do: `npm install base64-js` ## methods `var base64 = require('base64-js')` `base64` has two exposed functions, `toByteArray` and `fromByteArray`, which both take a single argument. * `toByteArray` - Takes a base64 string and returns a byte array * `fromByteArray` - Takes a byte array and returns a base64 string ## license MIT
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 19553 | swellard | Move and rename clients | ||
//guest/perforce_software/helix-web-services/main/source/clients/2016.1.0/javascript/node_modules/base64-js/README.md | |||||
#1 | 18810 | tjuricek |
First-pass at JavaScript client SDK. JavaScript requires Node with Gulp to "browserfy" the library. It's the easiest way I found to use the swagger-js project; bundle up a wrapping method. There is no JavaScript reference guide. The swagger-js doesn't really document what they do very well, actually. Overall I'm not particularly impressed by swagger-js, it was hard to even figure out what the right method syntax was. We may want to invest time in doing it better. This required setting CORS response headers, which are currently defaulted to a fairly insecure setting. |