{"nyc":{"temp-directory":"./coverage/.nyc_output"},"bugs":{"url":"https://github.com/EOSIO/eosjs-ecc/issues"},"dist":{"shasum":"908e6cdcdca4b4a3602c3131ab4ec75c72371935","tarball":"https://registry.npmjs.org/eosjs-ecc/-/eosjs-ecc-4.0.4-168dae3.0.tgz","fileCount":20,"integrity":"sha512-0IWRb0V1lNinZVcGqXygjmjfdj5R3jpSigKF3vs9eoecqomX1eoLotM5wD9CoTlJ6CNWa7RyZCBgHqWT73MdKg==","signatures":[{"sig":"MEUCIQDoXP3XLBDVvDJw8z+kp+aB6dDMv6mfifG6m1MpiSnwOgIgfiqPI7mNByrptq2ZTTvdcMmzC1NSHPtYBkqBfwgINtk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1248244,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiQ8oCRA9TVsSAnZWagAALiQQAJE33Jv6bZtg55TjmFCM\nzByj9RFCkfVbz6xbDKlP/NgCAs9uI3b9EDlChByPmtRTtoZ/GEZGjv7BeZN7\n5fyx2kX88r99zKuhN7BI65TgwenMNW0GzYbDxlJSIxjfeNhjGOPywvVosZQ4\nIxBcmQ42zXbPeDW3Ak/zmSMqd4TbA78AJFuO8ERPoTJtqBVLYqQd+kHGb+p2\n5YoaVzi6f44I1LYOAlbCqGGiWeUmbQ7Jg8jB7exdYkvwB/kKBdcYRMnZ6RG0\nQp794LCSfbGZ7PxGbgd2VP1S4HQmixH/xa96wiy1wVb3x3CpaQkmsRHuO6GO\ncb44zFqVFA5j/uKwOCOUt3u/ty9Y2TrXaSXqZ/nv6ErA1iYdmu+3T8CRdn+9\nOQjxX8X3kLqz8r+MG5WF1glqHhUMj3Fz8SjvsSH85WLKHCNBr5+KziPLRjPp\ngz/PnXHgqfIw97m4ibH2qNS/7Kmbd+bBpduGGidtWPsoddwSk8Z++D495WLE\nJsngEXG1AvG9ixQvl71qN25hkd1vwK+HRiwRvNfjZKzv2jRg0JDi8xoE0zSw\nGXaLmCEU3wWrG4kb9syowXtDmVUTE2yTcVcMRuca989v0ojpTFqESmMsszZn\ngLJ0etyPUtOZ/juC76SXcXpdkXZJXVCGMvUq2zAS9PtsdDHRLHvuDXtG1/DD\nwMuh\r\n=fnB3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","name":"eosjs-ecc","babel":{"plugins":["@babel/plugin-transform-runtime"],"presets":["@babel/preset-env"]},"readme":"[![NPM](https://img.shields.io/npm/v/eosjs-ecc.svg)](https://www.npmjs.org/package/eosjs-ecc)\n[![Build Status](https://travis-ci.org/EOSIO/eosjs-ecc.svg?branch=master)](https://travis-ci.org/EOSIO/eosjs-ecc)\n\n# Elliptic curve cryptography functions (ECC)\n\nPrivate Key, Public Key, Signature, AES, Encryption / Decryption\n\n# Import\n\n```js\nimport ecc from 'eosjs-ecc'\n// or\nconst ecc = require('eosjs-ecc')\n```\n\n# Include\n\n-   Install with: `yarn add eosjs-ecc`\n-   Html script tag, see [releases](https://github.com/EOSIO/eosjs-ecc/releases) for the correct **version** and its matching script **integrity** hash.\n\n```html\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <!--\n  sha512-cL+IQQaQ586s9DrXfGtDheRpj5iDKh2M+xlpfwbhNjRIp4BGQ1fkM/vB4Ta8mc+f51YBW9sJiPcyMDIreJe6gQ== lib/eosjs-ecc.js\n  sha512-dYFDmK/d9r3/NCp6toLtfkwOjSMRBaEzaGAx1tfRItC0nsI0hVLERk05iNBQR7uDNI7ludYhcBI4vUiFHdjsTQ== lib/eosjs-ecc.min.js\n  sha512-eq1SCoSe38uR1UVuQMwR73VgY8qKTBDc87n2nIiC5WLhn1o2y1U6c5wY8lrigVX7INM8fM0PxDlMX5WvpghKig== lib/eosjs-ecc.min.js.map\n  -->\n  <script src=\"https://cdn.jsdelivr.net/npm/eosjs-ecc@4.0.4/lib/eosjs-ecc.min.js\"\n    integrity=\"sha512-dYFDmK/d9r3/NCp6toLtfkwOjSMRBaEzaGAx1tfRItC0nsI0hVLERk05iNBQR7uDNI7ludYhcBI4vUiFHdjsTQ==\"\n    crossorigin=\"anonymous\"></script>\n\n</head>\n<body>\n  See console object: eosjs_ecc\n</body>\n</html>\n```\n\n# Common API\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n### Table of Contents\n\n-   [wif](#wif)\n-   [ecc](#ecc)\n    -   [initialize](#initialize)\n    -   [unsafeRandomKey](#unsaferandomkey)\n    -   [randomKey](#randomkey)\n        -   [Parameters](#parameters)\n        -   [Examples](#examples)\n    -   [seedPrivate](#seedprivate)\n        -   [Parameters](#parameters-1)\n        -   [Examples](#examples-1)\n    -   [privateToPublic](#privatetopublic)\n        -   [Parameters](#parameters-2)\n        -   [Examples](#examples-2)\n    -   [isValidPublic](#isvalidpublic)\n        -   [Parameters](#parameters-3)\n        -   [Examples](#examples-3)\n    -   [isValidPrivate](#isvalidprivate)\n        -   [Parameters](#parameters-4)\n        -   [Examples](#examples-4)\n    -   [sign](#sign)\n        -   [Parameters](#parameters-5)\n        -   [Examples](#examples-5)\n    -   [signHash](#signhash)\n        -   [Parameters](#parameters-6)\n    -   [verify](#verify)\n        -   [Parameters](#parameters-7)\n        -   [Examples](#examples-6)\n    -   [recover](#recover)\n        -   [Parameters](#parameters-8)\n        -   [Examples](#examples-7)\n    -   [recoverHash](#recoverhash)\n        -   [Parameters](#parameters-9)\n    -   [sha256](#sha256)\n        -   [Parameters](#parameters-10)\n        -   [Examples](#examples-8)\n-   [pubkey](#pubkey)\n\n## wif\n\n[Wallet Import Format](https://en.bitcoin.it/wiki/Wallet_import_format)\n\nType: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\n\n## ecc\n\n### initialize\n\nInitialize by running some self-checking code.  This should take a\nsecond to gather additional CPU entropy used during private key\ngeneration.\n\nInitialization happens once even if called multiple times.\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** \n\n### unsafeRandomKey\n\nDoes not pause to gather CPU entropy.\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;PrivateKey>** test key\n\n### randomKey\n\n#### Parameters\n\n-   `cpuEntropyBits` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** gather additional entropy\n    from a CPU mining algorithm.  This will already happen once by\n    default. (optional, default `0`)\n\n#### Examples\n\n```javascript\necc.randomKey().then(privateKey => {\nconsole.log('Private Key:\\t', privateKey) // wif\nconsole.log('Public Key:\\t', ecc.privateToPublic(privateKey)) // EOSkey...\n})\n```\n\nReturns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)&lt;[wif](#wif)>** \n\n### seedPrivate\n\n#### Parameters\n\n-   `seed` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** any length string.  This is private.  The same\n    seed produces the same private key every time.  At least 128 random\n    bits should be used to produce a good private key.\n\n#### Examples\n\n```javascript\necc.seedPrivate('secret') === wif\n```\n\nReturns **[wif](#wif)** \n\n### privateToPublic\n\n#### Parameters\n\n-   `wif` **[wif](#wif)** \n-   `pubkey_prefix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** public key prefix (optional, default `'EOS'`)\n\n#### Examples\n\n```javascript\necc.privateToPublic(wif) === pubkey\n```\n\nReturns **[pubkey](#pubkey)** \n\n### isValidPublic\n\n#### Parameters\n\n-   `pubkey` **[pubkey](#pubkey)** like EOSKey..\n-   `pubkey_prefix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**  (optional, default `'EOS'`)\n\n#### Examples\n\n```javascript\necc.isValidPublic(pubkey) === true\n```\n\nReturns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** valid\n\n### isValidPrivate\n\n#### Parameters\n\n-   `wif` **[wif](#wif)** \n\n#### Examples\n\n```javascript\necc.isValidPrivate(wif) === true\n```\n\nReturns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** valid\n\n### sign\n\nCreate a signature using data or a hash.\n\n#### Parameters\n\n-   `data` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Buffer](https://nodejs.org/api/buffer.html))** \n-   `privateKey` **([wif](#wif) | PrivateKey)** \n-   `encoding` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** data encoding (if string) (optional, default `'utf8'`)\n\n#### Examples\n\n```javascript\necc.sign('I am alive', wif)\n```\n\nReturns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** string signature\n\n### signHash\n\n#### Parameters\n\n-   `dataSha256` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Buffer](https://nodejs.org/api/buffer.html))** sha256 hash 32 byte buffer or string\n-   `privateKey` **([wif](#wif) | PrivateKey)** \n-   `encoding` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** dataSha256 encoding (if string) (optional, default `'hex'`)\n\nReturns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** string signature\n\n### verify\n\nVerify signed data.\n\n#### Parameters\n\n-   `signature` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Buffer](https://nodejs.org/api/buffer.html))** buffer or hex string\n-   `data` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Buffer](https://nodejs.org/api/buffer.html))** \n-   `pubkey` **([pubkey](#pubkey) | PublicKey)** \n-   `encoding`   (optional, default `'utf8'`)\n-   `hashData` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** sha256 hash data before verify (optional, default `true`)\n\n#### Examples\n\n```javascript\necc.verify(signature, 'I am alive', pubkey) === true\n```\n\nReturns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** \n\n### recover\n\nRecover the public key used to create the signature.\n\n#### Parameters\n\n-   `signature` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Buffer](https://nodejs.org/api/buffer.html))** (EOSbase58sig.., Hex, Buffer)\n-   `data` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Buffer](https://nodejs.org/api/buffer.html))** full data\n-   `encoding` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** data encoding (if data is a string) (optional, default `'utf8'`)\n\n#### Examples\n\n```javascript\necc.recover(signature, 'I am alive') === pubkey\n```\n\nReturns **[pubkey](#pubkey)** \n\n### recoverHash\n\n#### Parameters\n\n-   `signature` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Buffer](https://nodejs.org/api/buffer.html))** (EOSbase58sig.., Hex, Buffer)\n-   `dataSha256` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Buffer](https://nodejs.org/api/buffer.html))** sha256 hash 32 byte buffer or hex string\n-   `encoding` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** dataSha256 encoding (if dataSha256 is a string) (optional, default `'hex'`)\n\nReturns **PublicKey** \n\n### sha256\n\n#### Parameters\n\n-   `data` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Buffer](https://nodejs.org/api/buffer.html))** always binary, you may need Buffer.from(data, 'hex')\n-   `resultEncoding`   (optional, default `'hex'`)\n-   `encoding` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** result encoding 'hex', 'binary' or 'base64' (optional, default `'hex'`)\n\n#### Examples\n\n```javascript\necc.sha256('hashme') === '02208b..'\n```\n\n```javascript\necc.sha256(Buffer.from('02208b', 'hex')) === '29a23..'\n```\n\nReturns **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \\| [Buffer](https://nodejs.org/api/buffer.html))** Buffer when encoding is null, or string\n\n## pubkey\n\nEOSKey..\n\nType: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)\n\n# Usage (Object API)\n\n```js\nlet {PrivateKey, PublicKey, Signature, Aes, key_utils, config} = require('eosjs-ecc')\n\n// Create a new random private key\nlet privateWif\nPrivateKey.randomKey().then(privateKey => privateWif = privateKey.toWif())\n\n// Convert to a public key\npubkey = PrivateKey.fromString(privateWif).toPublic().toString()\n```\n\n-   [PrivateKey](./src/key_private.js)\n-   [PublicKey](./src/key_public.js)\n-   [Signature](./src/signature.js)\n-   [Aes](./src/aes.js)\n-   [key_utils](./src/key_utils.js)\n-   [config](./src/config.js)\n\n# Browser\n\n```bash\ngit clone https://github.com/EOSIO/eosjs-ecc.git\ncd eosjs-ecc\nyarn\nyarn build_browser\n# builds: ./dist/eosjs-ecc.js\n# Verify release hash\n```\n\n```html\n<script src=eosjs-ecc.js></script>\n```\n\n```js\nvar ecc = eosjs_ecc\n\necc.randomKey().then(privateWif =>  {\n  var pubkey = ecc.privateToPublic(privateWif)\n  console.log(pubkey)\n})\n```\n","gitHead":"844cb4895ccd894b856d36d312768f1d4e414a5d","license":"MIT","scripts":{"docs":"yarn documentation -- readme src/api_common.js --section \"Common API\" --shallow","test":"mocha --use_strict src/*.test.js","build":"yarn build_lib && yarn build_browser","srisum":"npx srisum lib/eosjs-ecc.*","coverage":"nyc --reporter=lcov --reporter=text npm test","minimize":"terser lib/eosjs-ecc.js -o lib/eosjs-ecc.min.js --source-map --compress --mangle","test_lib":"mocha --use_strict lib/*.test.js","build_lib":"rm -f lib/* && babel src --out-dir lib","coveralls":"yarn coverage && cat ./coverage/lcov.info | ./node_modules/.bin/coveralls","build_browser":"mkdir -p lib && browserify -o lib/eosjs-ecc.js -s eosjs_ecc lib/index.js","documentation":"node_modules/documentation/bin/documentation.js","prepublishOnly":"yarn build && yarn minimize && yarn test_lib && yarn docs","build_browser_test":"yarn build && browserify -o dist/test.js lib/*.test.js"},"_npmUser":{"name":"b1serviceaccount","email":"service.npm@block.one"},"homepage":"https://github.com/EOSIO/eosjs-ecc#readme","keywords":["ECC","Private Key","Public Key","Signature","AES","Encryption","Decryption"],"repository":{"url":"git://github.com/EOSIO/eosjs-ecc.git","type":"git"},"_npmVersion":"6.4.1","description":"Elliptic curve cryptography functions","directories":{},"maintainers":[{"name":"b1serviceaccount","email":"service.npm@block.one"},{"name":"benbenben1010","email":"ben.rush@block.one"},{"name":"chris-allnutt","email":"chris.allnutt@block.one"},{"name":"j8u8s8t8i8n8","email":"justin.brown2@gmail.com"},{"name":"jeffreyssmith2nd","email":"jeffreyssmith2nd@gmail.com"},{"name":"julienheller","email":"julien.heller@block.one"},{"name":"smetelin","email":"serg.metelin@gmail.com"},{"name":"takn","email":"nelson.ramirez@block.one"}],"_nodeVersion":"10.0.0","dependencies":{"bigi":"1.4.2","bs58":"4.0.1","ecurve":"1.0.5","bytebuffer":"5.0.1","create-hash":"1.1.3","create-hmac":"1.1.6","randombytes":"2.0.5","@babel/runtime":"7.6.0","browserify-aes":"1.0.6"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^14.1.0","mocha":"^5.2.0","terser":"^3.17.0","istanbul":"^0.4.5","coveralls":"^3.0.3","@babel/cli":"^7.6.0","browserify":"^16.2.3","@babel/core":"^7.6.0","documentation":"^8.1.1","@babel/preset-env":"^7.6.0","@babel/plugin-transform-runtime":"^7.6.0"},"_npmOperationalInternal":{"tmp":"tmp/eosjs-ecc_4.0.4-168dae3.0_1569263399717_0.951140349717734","host":"s3://npm-registry-packages"},"_id":"eosjs-ecc@4.0.4-168dae3.0","version":"4.0.4-168dae3.0"}