1 | base64-js
|
2 | =========
|
3 |
|
4 | `base64-js` does basic base64 encoding/decoding in pure JS.
|
5 |
|
6 | [![build status](https://secure.travis-ci.org/beatgammit/base64-js.png)](http://travis-ci.org/beatgammit/base64-js)
|
7 |
|
8 | [![testling badge](https://ci.testling.com/beatgammit/base64-js.png)](https://ci.testling.com/beatgammit/base64-js)
|
9 |
|
10 | Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data.
|
11 |
|
12 | Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does.
|
13 |
|
14 | ## install
|
15 |
|
16 | With [npm](https://npmjs.org) do:
|
17 |
|
18 | `npm install base64-js`
|
19 |
|
20 | ## methods
|
21 |
|
22 | `var base64 = require('base64-js')`
|
23 |
|
24 | `base64` has two exposed functions, `toByteArray` and `fromByteArray`, which both take a single argument.
|
25 |
|
26 | * `toByteArray` - Takes a base64 string and returns a byte array
|
27 | * `fromByteArray` - Takes a byte array and returns a base64 string
|
28 |
|
29 | ## license
|
30 |
|
31 | MIT |
\ | No newline at end of file |