{"name":"rfc4648","version":"1.5.0","description":"Encoding and decoding for base64, base32, base16, and friends","keywords":["Uint8Array","base16","base32","base32hex","base64","base64url","hex"],"repository":{"type":"git","url":"git+ssh://git@github.com/swansontec/rfc4648.js.git"},"license":"MIT","author":{"name":"William Swanson"},"exports":{".":{"import":"./lib/index.mjs","require":"./lib/index.js"},"./package.json":"./package.json"},"main":"./lib/index.js","module":"./lib/rfc4648.js","types":"./lib/src/index.d.ts","scripts":{"build.lib":"rollup -c","build.types":"tsc","clean":"rimraf lib","fix":"npm run lint -- --fix","lint":"eslint --ext .js,.ts .","precommit":"npm-run-all lint -p test build.*","prepare":"npm-run-all clean -p build.*","test":"nyc mocha test/**/*.ts"},"husky":{"hooks":{"pre-commit":"npm run precommit"}},"devDependencies":{"@babel/core":"^7.14.0","@babel/preset-env":"^7.14.1","@babel/preset-typescript":"^7.13.0","@rollup/plugin-babel":"^5.3.0","@rollup/plugin-node-resolve":"^13.0.0","@types/chai":"^4.2.18","@types/mocha":"^8.2.2","@typescript-eslint/eslint-plugin":"^4.8.2","@typescript-eslint/parser":"^4.8.2","babel-eslint":"^10.1.0","chai":"^4.3.4","eslint":"^7.14.0","eslint-config-standard-kit":"0.15.1","eslint-plugin-flowtype":"^5.2.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-promise":"^4.2.1","eslint-plugin-simple-import-sort":"^6.0.1","husky":"^4.3.0","lint-staged":"^10.5.3","mocha":"^8.4.0","npm-run-all":"^4.1.5","nyc":"^15.1.0","prettier":"^2.2.0","rimraf":"^3.0.2","rollup":"^2.47.0","rollup-plugin-filesize":"^9.1.1","rollup-plugin-flow-entry":"^0.3.5","rollup-plugin-mjs-entry":"^0.1.1","rollup-plugin-uglify":"^6.0.4","sucrase":"^3.18.1","typescript":"^4.1.2"},"gitHead":"a1b6de16e7f1c57598a5f2238292f1b4be504a92","bugs":{"url":"https://github.com/swansontec/rfc4648.js/issues"},"homepage":"https://github.com/swansontec/rfc4648.js#readme","_id":"rfc4648@1.5.0","_nodeVersion":"16.2.0","_npmVersion":"6.14.5","dist":{"integrity":"sha512-FA6W9lDNeX8WbMY31io1xWg+TpZCbeDKsBo0ocwACZiWnh9TUAyk9CCuBQuOPmYnwwdEQZmraQ2ZK7yJsxErBg==","shasum":"1ba940ec1649685ec4d88788dc57fb8e18855055","tarball":"http://registry-npm.ywwl.com/rfc4648/download/rfc4648-1.5.0.tgz","fileCount":14,"unpackedSize":23461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgrXoECRA9TVsSAnZWagAArmEP/3E0B5h+8oj0DND2S+nY\nbir3l27DHNxE5dPWRWr5KCNmBU7rpykZ0N3DM1x9qNqSqP2D2OB2ZhGlLT+9\nmwILBBtJPJNvtghau89PlhDQSmD3yKdJxB34nuQLVIDr+ehoXwlgvHphntwh\nZ51kyqmnVBirp88z2yiek9tnn1+cdLgG+7gQmntLvc0JtKp7uw0xUasYJA01\ncUaJI3OiFc3Y+D0vAICWJmMwyoHe6NDXYcDIOyk/xMQQAcbEP+v7bFO652Zo\nl2eFDCE9MQgwV696ddsOxwx6UqPdyuuYc34yHFWLphRXAO7OLwsmakeId6yu\nuFwyh4L4d86eC64AhjZlsZayolw0YCIWpYbyEqNWk4TGj2Nw+GEu8NobBLHW\nzQTaOQNfs//24S5/tOQUcqSyG4s1gDkyOy2X7dR+Eidf5hkZu2WVXx7ONcHD\ncjywTJIUwJ3Sdgvylqb4Pw24gNN0NwFaHYeCrk2aDnS93D+1gvdCEvTWV2Ia\nZ0n1SgsxKVYNyy8CMfbK1Hf6fwQkQ7lyrtIFch2s6FUl8mnS4ETVOh4rw8wf\nTaYZOml+U0gT01SSzz2uwj6UhTcfGsTmFLcBoGtAAgBtcg0nEWqoDxF5tCL2\ntSpByMrSu0DM2c2g/hIpZdWB4URblgEx/+pRVPWrThGB4IThfEx6gtG+Fsxv\nG08i\r\n=lfAj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNHG1Iid8//xSdKq/6HmPvQsF38dFhk+LxtAbvHB1pRgIhANjzrsOjtJzGBAjlE+zQinta14C6bU629KAdSc95T2jj"}],"size":5524,"noattachment":false,"key":"/rfc4648/-/rfc4648-1.5.0.tgz"},"_npmUser":{"name":"swansontec","email":"swansontec@gmail.com"},"directories":{},"maintainers":[{"name":"swansontec","email":"swansontec@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rfc4648_1.5.0_1621981700270_0.5615701996021973"},"_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":1621981700398,"_cnpm_publish_time":1621981700398,"dist-tags":{"latest":"1.5.4"}}