{"name":"rfc4648","version":"1.2.0","description":"Encoding and decoding for base64, base32, base16, and friends","license":"MIT","keywords":["base16","base32","base32hex","base64","base64url","hex","Uint8Array"],"author":{"name":"William Swanson"},"main":"lib/index.cjs.js","module":"lib/index.js","repository":{"type":"git","url":"git+ssh://git@github.com/swansontec/rfc4648.js.git"},"scripts":{"build":"buble -i src --o lib --no modules && rollup -c","lint":"standard '*.js' 'src/**/*.js' 'test/**/*.js'","prepublish":"npm run lint && npm run build","test":"npm run lint && rollup -c && nyc mocha"},"devDependencies":{"mocha":"^5.0.5","nyc":"^11.6.0","rollup":"^0.57.1","rollup-plugin-buble":"^0.19.2","rollup-plugin-filesize":"^1.3.2","rollup-plugin-uglify":"^3.0.0","standard":"^11.0.1"},"gitHead":"a7831176df2860201a92f98bc9fe6639c3ad5ad8","bugs":{"url":"https://github.com/swansontec/rfc4648.js/issues"},"homepage":"https://github.com/swansontec/rfc4648.js#readme","_id":"rfc4648@1.2.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"swansontec","email":"swansontec@gmail.com"},"dist":{"integrity":"sha512-1xXyagzIHbODo+t7PIxr2kVuax6J5rypj8zCfMg3xX0fPsCMp8Rf2SSq0mkzfH8BRoN8bQM//fxvwxySa19zaQ==","shasum":"7ab9f754143f02463156f637af5dbd28aa3b8e20","tarball":"http://registry-npm.ywwl.com/rfc4648/download/rfc4648-1.2.0.tgz","fileCount":13,"unpackedSize":23875,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcp9qmCRA9TVsSAnZWagAA4tgP/2NyvD5jnowhIDCVl4du\nOEHkmQVVX5ZWWtYTih9TfoUDFJ8ey0EpbvP56eq4qqUSmbRgzkQEvYki1w3F\nIAI1CN7V3JnMuHlsw+iJk98sD4FTy6ClZO3B/xcNWJkV3BqGOV7/13HYagmP\nn+C1BObMslVjreblCDwujp7gWTa62w3xn06u+gz8KI94H4nZpQ15MmtMmBNp\nKhj+/8LeHe1i1wUfBwFbjxGOaBVp+wj86+cRSgkXZVD4PrrIhiHZXoYW1+wC\nAjALpyJCYWfq0PysBJOyN9tKWJEUD80eTZREY6h8ebXCLFeHmHoZ7vj90ABI\nLgvF4Ya2ubkccGoQmpwtddAlc1fdh1ilD7lU3omqKGg/GiJK0P/T4MzE6Pks\nsW68oxnWoRyxKbeIuvOXywWCTnpqeurTjRjH+/6c0sGNuTxdL9hR3SE5e0BV\n60ilJAOOpATNWc+bxFAysk5Unho4aMF1ezqCWjbKeTxyVNmbo16r5oFZ6O7j\ndhf+Mk1LHh1w9WH4wj9S8iNeAWVEfPk7APZ5f/JSIOJN+H2Rz+C86+KgltWB\nLE0vA5PTxrKJ6Ju/pHzBHZGGeyaP2XI6722XvQHzFXccoJsslTUT68Ruus9p\ns8rM5Nu/OnRMqIKHOaNdYl30WyoO/YciKQKZ+XD6hXCiLBSXzhVRS134VSK8\nTOK0\r\n=CQ4O\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpg+wBdVAY0w4t1e7VEX8X3a3bq5bcGo12X02LDiGHjAIgEgiauLqAB/wRcpR80FA2U1FhoxQibYo2AVrE5L+6YUI="}],"size":5795,"noattachment":false,"key":"/rfc4648/-/rfc4648-1.2.0.tgz"},"maintainers":[{"name":"swansontec","email":"swansontec@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rfc4648_1.2.0_1554504357819_0.2227130086106972"},"_hasShrinkwrap":false,"readme":"# rfc4648.js\n\n[![Build Status](https://travis-ci.com/swansontec/rfc4648.js.svg?branch=master)](https://travis-ci.com/swansontec/rfc4648.js)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\nThis library implements encoding and decoding for the data formats specified in [rfc4648](https://tools.ietf.org/html/rfc4648):\n\n- base64\n- base64url\n- base32\n- base32hex\n- base16\n\nEach encoding has a simple API inspired by Javascript's built-in `JSON` object:\n\n```js\nimport { base32 } from \"rfc4648\";\n\nbase32.stringify([42, 121, 160]); // -> 'FJ42A==='\nbase32.parse(\"FJ42A===\"); // -> Uint8Array([42, 121, 160])\n```\n\nThe library has tree-shaking support, so tools like [rollup.js](https://rollupjs.org/) or [Webpack 2+](https://webpack.js.org/) can automatically trim away any encodings you don't use.\n\n- Zero external dependencies\n- 100% test coverage\n- Built-in types for Typescript & Flow\n- 0.8K minified + gzip (can be even smaller with tree shaking)\n\n## API details\n\nThe library provides the following top-level modules:\n\n- `base64`\n- `base64url`\n- `base32`\n- `base32hex`\n- `base16`\n- `codec`\n\nEach module exports a `parse` and `stringify` function.\n\n### const string = baseXX.stringify(data, opts)\n\nEach `stringify` function takes array-like object of bytes and returns a string.\n\nIf you pass the option `{ pad: false }` in the second parameter, the encoder will not output padding characters (`=`).\n\n### const data = baseXX.parse(string, opts)\n\nEach `parse` function takes a string and returns a `Uint8Array` of bytes. If you would like a different return type, such as plain `Array` or a Node.js `Buffer`, pass its constructor in the second argument:\n\n```js\nbase64.parse(\"AOk=\", { out: Array });\nbase64.parse(\"AOk=\", { out: Buffer.allocUnsafe });\n```\n\nThe constructor will be called with `new`, and should accept a single integer for the output length, in bytes.\n\nIf you pass the option `{ loose: true }` in the second parameter, the parser will not validate padding characters (`=`):\n\n```js\nbase64.parse(\"AOk\", { loose: true }); // No error\n```\n\nThe base32 codec will also fix common typo characters in loose mode:\n\n```js\nbase32.parse(\"He1l0==\", { loose: true }); // Auto-corrects as 'HELLO==='\n```\n\n### Custom encodings\n\nTo define your own encodings, use the `codec` module:\n\n```js\nconst codec = require(\"rfc4648\").codec;\n\nconst myEncoding = {\n  chars: \"01234567\",\n  bits: 3\n};\n\ncodec.stringify([220, 10], myEncoding); // '670050=='\ncodec.parse(\"670050\", myEncoding, { loose: true }); // [ 220, 10 ]\n```\n\nThe `encoding` structure should have two members, a `chars` member giving the alphabet and a `bits` member giving the bits per character. The `codec.parse` function will extend this with a third member, `codes`, the first time it's called. The `codes` member is a lookup table mapping from characters back to numbers.\n","publish_time":1554504357979,"_cnpm_publish_time":1554504357979,"dist-tags":{"latest":"1.5.4"}}