{"name":"ethashjs","version":"0.0.1","description":"an ethash implementation in JS","main":"index.js","directories":{"test":"tests"},"scripts":{"test":"node ./tests/"},"repository":{"type":"git","url":"git+https://github.com/ethereum/ethashjs.git"},"keywords":["ethash","ethereum","POW"],"author":{"name":"mjbecze","email":"mjbecze@gmail.com"},"license":"MPL-2.0","bugs":{"url":"https://github.com/ethereum/ethashjs/issues"},"homepage":"https://github.com/ethereum/ethashjs#readme","dependencies":{"async":"^1.4.2","bitwise-xor":"0.0.0","es6-shim":"^0.33.0","ethereum-tests":"git+https://github.com/ethereum/tests.git","ethereumjs-util":"^1.3.6","miller-rabin":"^2.1.0"},"devDependencies":{"ethereumjs-block":"0.0.4","levelup":"^1.2.1","memdown":"^1.0.0","tape":"^4.0.1"},"gitHead":"095f84ae31f17576a9b8347fd9cc2bc4f2db98c3","_id":"ethashjs@0.0.1","_shasum":"7f3cf3ebdd0d450139371084fa49f3c0c963d21d","_from":".","_npmVersion":"2.13.2","_nodeVersion":"0.12.7","_npmUser":{"name":"null_radix","email":"mjbecze@gmail.com"},"dist":{"shasum":"7f3cf3ebdd0d450139371084fa49f3c0c963d21d","tarball":"http://registry-npm.ywwl.com/ethashjs/download/ethashjs-0.0.1.tgz","integrity":"sha512-wXxQaZHYFqj2157UKafCZW5/Xe/wAuCZJbrS2v26JCemm9JdvBHkRkn+mTBmYryq6r7Tx0oRt+YdJLxqGxVJ9Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHVOBITRLyfQRXkfTPkFRpsUrA/7VvA8QSQYJw0kI8kQAiBdlWSPiA2aFz2JyP3HzyiPK7DY2K/bGSsvoXhzQLVcUA=="}],"size":12582,"noattachment":false,"key":"/ethashjs/-/ethashjs-0.0.1.tgz"},"maintainers":[{"name":"null_radix","email":"mjbecze@gmail.com"}],"deprecated":"New package name format for new versions: @ethereumjs/ethash. Please update.","readme":"# SYNOPSIS\n\n[![NPM Package](https://img.shields.io/npm/v/ethashjs.svg)](https://www.npmjs.org/package/ethashjs)\n[![Actions Status](https://github.com/ethereumjs/ethashjs/workflows/Build/badge.svg)](https://github.com/ethereumjs/ethashjs/actions)\n[![Coverage Status](https://img.shields.io/coveralls/ethereumjs/ethashjs.svg)](https://coveralls.io/r/ethereumjs/ethashjs)\n[![Gitter](https://img.shields.io/gitter/room/ethereum/ethereumjs-lib.svg)](https://gitter.im/ethereum/ethereumjs-lib)\n\nImplements [Ethash](https://github.com/ethereum/wiki/wiki/Ethash).\n\n# INSTALL\n\n`npm install ethashjs`\n\n# USAGE\n\n```javascript\nconst Ethash = require('ethashjs')\nconst Block = require('ethereumjs-block')\nconst levelup = require('levelup')\nconst memdown = require('memdown')\n\nvar cacheDB = levelup('', {\n  db: memdown\n})\n\nvar ethash = new Ethash(cacheDB)\nvar validblockRlp =\n  'f90667f905fba0a8d5b7a4793baaede98b5236954f634a0051842df6a252f6a80492fd888678bda01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a0f93c8db1e931daa2e22e39b5d2da6fb4074e3d544094857608536155e3521bc1a0bb7495628f9160ddbcf6354380ee32c300d594e833caec3a428041a66e7bade1a0c7778a7376099ee2e5c455791c1885b5c361b95713fddcbe32d97fd01334d296b90100000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000400000000000000000000000000000000000000000000000000000008302000001832fefd882560b84559c17b9b9040001020304050607080910111213141516171819202122232410000000000000000000200000000000000000003000000000000000000040000000000000000000500000000000000000006000000000000000000070000000000000000000800000000000000000009000000000000000000010000000000000000000100000000000000000002000000000000000000030000000000000000000400000000000000000005000000000000000000060000000000000000000700000000000000000008000000000000000000090000000000000000000100000000000000000001000000000000000000020000000000000000000300000000000000000004000000000000000000050000000000000000000600000000000000000007000000000000000000080000000000000000000900000000000000000001000000000000000000010000000000000000000200000000000000000003000000000000000000040000000000000000000500000000000000000006000000000000000000070000000000000000000800000000000000000009000000000000000000010000000000000000000100000000000000000002000000000000000000030000000000000000000400000000000000000005000000000000000000060000000000000000000700000000000000000008000000000000000000090000000000000000000100000000000000000001000000000000000000020000000000000000000300000000000000000004000000000000000000050000000000000000000600000000000000000007000000000000000000080000000000000000000900000000000000000001000000000000000000010000000000000000000200000000000000000003000000000000000000040000000000000000000500000000000000000006000000000000000000070000000000000000000800000000000000000009000000000000000000010000000000000000000100000000000000000002000000000000000000030000000000000000000400000000000000000005000000000000000000060000000000000000000700000000000000000008000000000000000000090000000000000000000100000000000000000001000000000000000000020000000000000000000300000000000000000004000000000000000000050000000000000000000600000000000000000007000000000000000000080000000000000000000900000000000000000001000000000000000000010000000000000000000200000000000000000003000000000000000000040000000000000000000500000000000000000006000000000000000000070000000000000000000800000000000000000009000000000000000000010000000000000000000a09c7b47112a3afb385c12924bf6280d273c106eea7caeaf5131d8776f61056c148876ae05d46b58d1fff866f864800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba01d2c92cfaeb04e53acdff2b5d42005ff6aacdb0105e64eb8c30c273f445d2782a01e7d50ffce57840360c57d94977b8cdebde614da23e8d1e77dc07928763cfe21c0'\n\nvar validblock = new Block(Buffer.from(validblockRlp, 'hex'))\n\nethash.verifyPOW(validblock, function (result) {\n  console.log(result)\n})\n```\n\n# BROWSER\n\nYep, you can [browserify](http://browserify.org/) it.\n\n# API\n\n- [`new Ethash([cacheDB])`](#newethashcachedb)\n- [`ethash.verifyPOW(block, cb)`](#ethashverifypowblock-cb)\n- [`ethash.mkcache(cacheSize, seed)`](#ethashmkcachecachesize-seed)\n- [`ethash.run(val, nonce, fullsize)`](#ethashrunval-nonce-fullsize)\n\n### `new Ethash([cacheDB])`\n\nCreates a new instance of `Ethash`.\n\n**Parameters**\n\n- `cacheDB` - an instance of a levelup db which is used to store the cache(s)\n\n### `ethash.verifyPOW(block, cb)`\n\nVerifies the POW on a block and its uncles\n\n**Parameters**\n\n- `block` - the [block](https://github.com/ethereum/ethereumjs-block) to verify\n- `cb` - the callback which is given a `Boolean` determining the validaty of the block\n\n### `ethash.mkcache(cacheSize, seed)`\n\nCreates a cache. NOTE: this is automatically done for in - [`ethash.verifyPOW(block, cb)`](#ethashverifypowblock-cb) so you do not need to use this function if you are just validating blocks\n\n**Parameters**\n\n- `cachSize` - the size of the cach\n- `seed` - the seed as a `Buffer`\n\n### `ethash.run(val, nonce, fullsize)`\n\nRuns ethash on a give val/nonce pair. NOTE: you need to run [`ethash.mkcache(cacheSize, seed)`](#ethashverifypowcachesize-seed) first before using this function.\n\n**Parameters**\n\n- `val` - value to run ethash on e.g. the header hash\n- `nonce` - the nonce used for this hash attempt\n- `fullsize` - the fullsize of the cache.\n\n**Returns**\n\nAn `Object` containing:\n\n- `hash` - the hash of the value\n- `mix` - the mis result\n\n# TESTS\n\n`npm test`\n\n# LICENSE\n\n[MPL-2.0](https://www.mozilla.org/MPL/2.0/)\n","publish_time":1439172656705,"_cnpm_publish_time":1439172656705,"dist-tags":{"latest":"0.0.8"}}