{"name":"bcoin-native","version":"0.0.6","description":"Native bindings to bitcoin-related functions","keywords":["bcoin","bitcoin"],"bugs":{"url":"https://github.com/bcoin-org/bcoin-native/issues"},"homepage":"https://github.com/bcoin-org/bcoin-native","license":"MIT","author":{"name":"Christopher Jeffrey","email":"chjjeffrey@gmail.com"},"main":"./index.js","repository":{"type":"git","url":"git://github.com/bcoin-org/bcoin-native.git"},"scripts":{"install":"node-gyp rebuild","test":"node test.js","bench":"node bench.js"},"dependencies":{"bindings":"1.2.1","nan":"2.4.0"},"engines":{"node":">= 0.10"},"gypfile":true,"gitHead":"84fef0c6ce3d834145d246ba27a0a1609648b453","_id":"bcoin-native@0.0.6","_shasum":"5a3341a9fea411992006c26bf4343c837e9be344","_from":".","_npmVersion":"3.10.7","_nodeVersion":"6.5.0","_npmUser":{"name":"chjj","email":"chjjeffrey@gmail.com"},"maintainers":[{"name":"chjj","email":"chjjeffrey@gmail.com"}],"dist":{"shasum":"5a3341a9fea411992006c26bf4343c837e9be344","tarball":"http://registry-npm.ywwl.com/bcoin-native/download/bcoin-native-0.0.6.tgz","integrity":"sha512-2Yf8G2oW8s+KEnVbK34ns9c6dQVkwpq0Gr7jNFZEXDRHEyN2qxcSThPRksWA/+xvTzOvoczZZKvfpbroJetILA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB+59izgNfAb0hPOrXnTgQftaoov6gb2ct8S3LS4iGXwAiEA6xghyBv1qWUKmJdfqkru2OtHAemxazMmEJUTbi1oHwI="}],"size":32330,"noattachment":false,"key":"/bcoin-native/-/bcoin-native-0.0.6.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/bcoin-native-0.0.6.tgz_1474710220568_0.040726520121097565"},"directories":{},"readme":"# bcoin-native\n\nThe missing crypto and encoding bindings for node.js.\n\nThis module provides _native bindings_ to all lowlevel optimizable things used\nin bitcoin.\n\nUsed in [bcoin][bcoin].\n\n## Functions\n  - `hash(alg, data)`\n  - `hmac(alg, data)`\n  - `ripemd160(data)`\n  - `sha1(data)`\n  - `sha256(data)`\n  - `hash160(data)`\n  - `hash256(data)`\n  - `root256(left, right)`\n  - `toBase58(data)`\n  - `fromBase58(data)`\n  - `toBech32(hrp, version, hash)`\n  - `fromBech32(str)`\n  - `scrypt(pass, salt, n, r, p, klen)`\n  - `scryptAsync(pass, salt, n, r, p, klen)`\n  - `murmur3(data, seed)`\n  - `siphash(data, key)`\n  - `siphash256(data, key)`\n  - `cleanse(data)`\n  - `encipher(data, key, iv)`\n  - `decipher(data, key, iv)`\n\n## Objects\n  - `Poly1305()`\n    - `#init(key)`\n    - `#update(data)`\n    - `#finish()`\n    - `.verify(mac1, mac2)`\n    - `.auth(data, key)`\n  - `ChaCha20()`\n    - `#init(key?, iv?, counter?)`\n    - `#initKey(key)`\n    - `#initIV(iv, counter?)`\n    - `#encrypt(data)`\n    - `#getCounter()`\n    - `#setCounter(counter)`\n\n## Usage\n\n``` js\nvar native = require('bcoin-native');\nvar data = Buffer.from('01020304', 'hex');\nvar key = Buffer.from('05060708', 'hex');\n\nvar hash1 = native.sha256(data);\nvar hash2 = native.hash256(data);\n\nconsole.log('sha256: %s', hash1.toString('hex'));\nconsole.log('double sha256: %s', hash2.toString('hex'));\n```\n\nOutputs:\n\n```\nsha256: 9f64a747e1b97f131fabb6b447296c9b6f0201e79fb3c5356e6c77e89b6a806a\ndouble sha256: 8de472e2399610baaa7f84840547cd409434e31f5d3bd71e4d947f283874f9c0\n```\n\n## Benchmarks\n\n``` bash\n$ node bench.js\ncrypto.sha256: ops=100000, time=0.41668067, rate=239991.93435\nnative.sha256: ops=100000, time=0.328309021, rate=304591.08219\ncrypto.hash160: ops=100000, time=0.698852504, rate=143091.71024\nnative.hash160: ops=100000, time=0.32359362, rate=309029.57852\ncrypto.hash256: ops=100000, time=0.65909456, rate=151723.29749\nnative.hash256: ops=100000, time=0.313477282, rate=319002.38308\ncrypto.sha256hmac: ops=100000, time=0.589858488, rate=169532.18786\nnative.sha256hmac: ops=100000, time=0.444996526, rate=224720.85546\nutils.toBase58: ops=100000, time=0.808880157, rate=123627.70818\nnative.toBase58: ops=100000, time=0.458057275, rate=218313.31027\nutils.fromBase58: ops=100000, time=0.77960898, rate=128269.43066\nnative.fromBase58: ops=100000, time=0.746901487, rate=133886.46527\njs poly1305.update: ops=31250, time=1.6195938239999998, rate=19294.96120\njs poly1305.finish: ops=31250, time=2.9935169999999998, rate=10439.22583\nc poly1305.update: ops=31250, time=0.184753504, rate=169144.28860\nc poly1305.finish: ops=31250, time=1.434867264, rate=21779.01802\njs murmur3: ops=1000000, time=4.714874642, rate=212094.71639\nc murmur3: ops=1000000, time=0.412050096, rate=2426889.37512\njs siphash256: ops=1000000, time=13.218189886, rate=75653.32384\nc siphash256: ops=1000000, time=1.19912212, rate=833943.41854\n```\n\n## License\n\nCopyright (c) 2016, Christopher Jeffrey. (MIT License)\n\nSee LICENSE for more info.\n\n[bcoin]: https://github.com/bcoin-org/bcoin\n","publish_time":1474710220785,"_cnpm_publish_time":1474710220785,"dist-tags":{"latest":"0.0.23"}}