{"_id":"@aleen42/idea","_rev":"1-ac3df2831f8fb3f42ce1719b367cda8b","name":"@aleen42/idea","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aleen42/idea","version":"1.0.0","description":"The IDEA cypher implementation in JavaScript","main":"dist/idea.min.js","scripts":{"lint":"eslint --ext .js .","prepublishOnly":"npm run lint && npm t && npm run build","build":"node build.js","test":"karma start karma.config.js"},"repository":{"type":"git","url":"git+https://github.com/coremail/IDEA.git"},"keywords":["IDEA","cypher"],"author":{"name":"Aleen","email":"aleen42@vip.qq.com"},"license":"MIT","bugs":{"url":"https://github.com/coremail/IDEA/issues"},"homepage":"https://github.com/coremail/IDEA#readme","devDependencies":{"@babel/core":"^7.16.5","@babel/preset-env":"^7.16.5","babel-loader":"^8.2.3","core-js":"^3.20.1","eslint":"^7.4.0","eslint-plugin-coremail":"0.4.1","terser-webpack-plugin":"^5.3.0","webpack":"^5.65.0","jasmine-core":"3.7.1","karma":"6.3.2","karma-chrome-launcher":"^3.1.0","karma-detect-browsers":"2.3.3","karma-edge-launcher":"^0.4.2","karma-firefox-launcher":"^2.1.0","karma-ie-launcher":"^1.0.0","karma-jasmine":"4.0.1","karma-mocha-reporter":"2.2.5","karma-safari-launcher":"^1.0.0","karma-sourcemap-loader":"0.3.8","karma-webpack":"5.0.0"},"dependencies":{"text-encoding":"^0.7.0"},"gitHead":"c994ba3516d658ad5c1ef66c99345a091e101a0e","_id":"@aleen42/idea@1.0.0","_nodeVersion":"17.2.0","_npmVersion":"8.1.4","dist":{"integrity":"sha512-ThFqweQj8DiTMPXqLSoKpdehDah1HXmBJ69HpNu83JMaUEzVGXx5XrsfE1EX8FoRqUxVKo6QFaqFdorXf+D2SQ==","shasum":"b8ceecec17cac99c529d60c76f25799808ef0de3","tarball":"https://registry.npmjs.org/@aleen42/idea/-/idea-1.0.0.tgz","fileCount":9,"unpackedSize":224437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2AF8CRA9TVsSAnZWagAAIPEQAIybJKYRmtsIHQl3R/fo\nExK3do0Sdgw+oaWozyu6z68V1GBM78PKqlJzjDIdX24e1RgeKdE9Es6kBPoU\nMpyAGPOKVTTHelrLTBMOh/wlW2RD+Hs5jqTAFRJe6HHE5x/phOdUFLTO9Hca\nztAGMfHbPWodCL0zGHtliKKtumjw1l2x99su57Z5tlB+/VwfBe+13HoAcQCn\n7DWDzTkcNgj04ZWRpXCcb7Hl1h83/8xH0/daT3P5Uh/hT18LS9j4gz56DHgK\nzIg9QrIDCDWUf2h9iaP4C+452Rx5wc2i/P5dus9F6azqZuJo40mLS8TRtsBR\n3wxg6u6iYAdYoq/waYHl4mHu70fMYTkEpcsBnBjZQOin4GTun4a9yFUu3M1b\nvxcungofoxgyanr9MxVR9SplRGhIJaqgAfbyviKie1pjmtxF0vzN25F0ECNj\nfiQ68NVEM2MD81LQ4xNdujs2LYyzE5HPWSr5woKp+a0aTI4wPJjvm3ymhNeu\nPefpM/uzwz5KBlRP/RUg0TJNp0Io8ZRSeTjRR367dAXE+WrYFWEOvnve0U4C\nWcAxmU9LYcriNVDjlq9Pt8Iw9DIwSEW5E4EsBZfTuega4h/ZRbpwUbHnzaOF\nVuUj2vPlsQ71bIuH0yU40MIfdjR+eIrAIdxwAN2O1U/JRvEypl4hJeRIHR6X\n8Yvb\r\n=OxuW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0kqcTcZHh/ualRv8QVRW5zUMHXgDM4iJ5r+tVP/XPdQIhAJHHjURNV/iyHldBOC9nXAt2zQhq9LvBL1DdA0Q4aB07"}]},"_npmUser":{"name":"aleen42","email":"aleen42@vip.qq.com"},"directories":{},"maintainers":[{"name":"aleen42","email":"aleen42@vip.qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/idea_1.0.0_1641546108182_0.03143277367072961"},"_hasShrinkwrap":false}},"time":{"created":"2022-01-07T09:01:48.123Z","1.0.0":"2022-01-07T09:01:48.403Z","modified":"2022-04-04T12:36:58.789Z"},"maintainers":[{"name":"aleen42","email":"aleen42@vip.qq.com"}],"description":"The IDEA cypher implementation in JavaScript","homepage":"https://github.com/coremail/IDEA#readme","keywords":["IDEA","cypher"],"repository":{"type":"git","url":"git+https://github.com/coremail/IDEA.git"},"author":{"name":"Aleen","email":"aleen42@vip.qq.com"},"bugs":{"url":"https://github.com/coremail/IDEA/issues"},"license":"MIT","readme":"## IDEA\n\n![npm](https://badges.aleen42.com/src/npm.svg) ![javascript](https://badges.aleen42.com/src/javascript.svg)\n\nIt is about the IDEA cypher which is implemented in JavaScript within ~10 KiB. If you want better compatibility, you may need the polyfill version `dist/idea.all.js`, which has shimmed [`Int8Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array) for you.\n\n### Compatibility\n\n- IE6+ (polyfills required for ES7- browsers)\n- NodeJS\n\n### Install\n\n```bash\nnpm install @aleen42/idea\n```\n\n### Usage\n\n- without padding:\n\n    ```js\n    function paddingToBytes(str) {\n        typeof str !== 'string' && (str = JSON.stringify(str));\n\n        const blockSize = 8;\n        const srcBytes = encoder.encode(str);\n        const len = Math.ceil(srcBytes.length / blockSize) * blockSize; // padding with \\x00\n        const src = new Int8Array(len);\n        src.set(srcBytes);\n        return src;\n    }\n  \n    const IDEA = require('@coremail/idea');\n    const idea = new IDEA(str2bytes('private key'), /* no padding */-1);\n    idea.encrypt(paddingToBytes('message')); // => Int8Array[]\n    ```\n\n- with xor padding (ENC3 by default):\n\n    ```js\n    const encoder = new TextEncoder(); \n    const IDEA = require('@coremail/idea');\n    const idea = new IDEA(str2bytes('private key'), /* ENC3 by default */197);\n    idea.encrypt(encoder.encode('message')); // => Int8Array[]\n    ```\n\n\n### Release History\n\n* ==================== **1.0.0 Initial release** ====================\n\n\n### :fuelpump: How to contribute\n\nHave an idea? Found a bug? See [how to contribute](https://wiki.aleen42.com/contribution.html).\n\n### :scroll: License\n\n[MIT](https://wiki.aleen42.com/MIT.html) © aleen42\n","readmeFilename":"README.md"}