commit 59bb062daca0de8311e42a7583131642a49c6298 Author: Matthew Little Date: Mon Jan 6 15:17:35 2014 -0500 inital commit diff --git a/blockNotify.js b/blockNotify.js new file mode 100644 index 0000000..9b78357 --- /dev/null +++ b/blockNotify.js @@ -0,0 +1,18 @@ +#!/usr/bin/env node + +var net = require('net'); + +var client = net.connect({port: 8124}, function() { + console.log('client connected'); + client.write(JSON.stringify(process.argv) + '\n'); +}); + +client.on('data', function(data) { + console.log(data.toString()); + //client.end(); +}); + +client.on('end', function() { + console.log('client disconnected'); + //process.exit(); +}); \ No newline at end of file diff --git a/blockTemplate.js b/blockTemplate.js new file mode 100644 index 0000000..c71f12b --- /dev/null +++ b/blockTemplate.js @@ -0,0 +1,53 @@ +var merkleTree = require('./merkleTree.js'); +var coinbase = require('./coinbase.js'); +var util = require('./util.js'); + + +var BlockTemplate = module.exports = function BlockTemplate(jobId, rpcData, address){ + + //private members + + function getMerkleHashes(steps){ + return steps.map(function(step){ + return util.reverseBuffer(step).toString('hex'); + }); + } + + function getTransactionBuffers(txs){ + var txHashes = txs.map(function(tx){ + return util.uint256BufferFromHash(tx.hash); + }); + return [null].concat(txHashes); + } + + + //public members + + this.rpcData = rpcData; + this.jobId = jobId; + this.merkleTree = new merkleTree(getTransactionBuffers(rpcData.transactions)); + this.merkleBranch = getMerkleHashes(this.merkleTree.steps); + this.coinbase = new coinbase.GenerationTransaction( + rpcData.coinbasevalue, + rpcData.coinbaseaux.flags, + rpcData.height, + address + ); + + this.getJobParams = function(){ + if (!this.jobParams){ + this.jobParams = [ + this.jobId, + util.reverseHex(this.rpcData.previousblockhash), + this.coinbase.serialized[0].toString('hex'), + this.coinbase.serialized[1].toString('hex'), + this.merkleBranch, + binpack.packInt32(this.rpcData.version, 'big').toString('hex'), + this.rpcData.bits, + binpack.packUInt32(this.rpcData.curtime, 'big').toString('hex'), + true + ]; + } + return this.jobParams; + } +} \ No newline at end of file diff --git a/coinbase.js b/coinbase.js new file mode 100644 index 0000000..d230ea3 --- /dev/null +++ b/coinbase.js @@ -0,0 +1,151 @@ +var binpack = require('/usr/lib/node_modules/binpack'); +var buffertools = require('/usr/lib/node_modules/buffertools'); + +var util = require('./util.js'); + + +function COutPoint(){ + this.hash = 0; + this.n = 0; +} +COutPoint.prototype = { + deserialize: function(f){ + this.hash = util.hexFromReversedBuffer(f.read(32)); + this.n = f.read(4).readUInt32LE(0); + }, + serialize: function(){ + return Buffer.concat([ + util.uint256BufferFromHash(this.hash), + binpack.packUInt32(this.n, 'little') + ]); + } +}; + + +function CTxIn(){ + this.prevout = new COutPoint(); + this.scriptSig = ""; + this.nSequence = 0; +} +CTxIn.prototype = { + deserialize: function(f){ + this.prevout = new COutPoint(); + this.prevout.deserialize(f); + this.scriptSig = util.deser_string(f); + this.nSequence = f.read(4).readUInt32LE(0); + }, + serialize: function(){ + return Buffer.concat([ + this.prevout.serialize(), + util.ser_string(this.scriptSig), + binpack.packUInt32(this.nSequence, 'little') + ]); + } +}; + + +function CTxOut(){ + this.nValue = 0; + this.scriptPubKey = ''; +} +CTxOut.prototype = { + deserialize: function(f){ + this.nValue = f.read(8).readInt64LE(0); + this.scriptPubKey = util.deser_string(f); + }, + serialize: function(){ + return Buffer.concat([ + binpack.packInt64(this.nValue, 'little'), + util.ser_string(this.scriptPubKey) + ]); + } +}; + + +function CTransaction(){ + this.nVersion = 1; + this.vin = []; + this.vout = []; + this.nLockTime = 0; + this.sha256 = null; +}; +CTransaction.prototype = { + deserialize: function(f){ + util.makeBufferReadable(f); + this.nVersion = f.read(4).readInt32LE(0); + this.vin = util.deser_vector(f, CTxIn); + this.vout = util.deser_vector(f, CTxOut); + this.nLockTime = r.read(4).readUInt32LE(0); + this.sha256 = null; + }, + serialize: function(){ + return Buffer.concat([ + binpack.packInt32(this.nVersion, 'little'), + util.ser_vector(this.vin), + util.ser_vector(this.vout), + binpack.packUInt32(this.nLockTime, 'little') + ]); + } +}; +exports.CTransaction = CTransaction; + + +var extranonce_placeholder = new Buffer('f000000ff111111f', 'hex'); +exports.extranonce_size = extranonce_placeholder.length; + + +function GenerationTransaction(coinbaseValue, coinbaseAuxFlags, height, address){ + var CTrans = new CTransaction(); + + var tx_in = new CTxIn(); + tx_in.prevout.hash = 0; + tx_in.prevout.n = Math.pow(2, 32) - 1; + tx_in._scriptSig_template = [ + Buffer.concat([ + util.serializeNumber(height), + new Buffer(coinbaseAuxFlags, 'hex'), + util.serializeNumber(Date.now() / 1000 | 0), + new Buffer([exports.extranonce_size]) + ]), + util.ser_string('/stratum/') + ]; + + tx_in.scriptSig = Buffer.concat([ + tx_in._scriptSig_template[0], + extranonce_placeholder, + tx_in._scriptSig_template[1] + ]); + + var tx_out = new CTxOut(); + tx_out.nValue = coinbaseValue; + tx_out.scriptPubKey = util.script_to_address(address); + + CTrans.vin.push(tx_in); + CTrans.vout.push(tx_out); + + var cTransBin = CTrans.serialize(); + var epIndex = buffertools.indexOf(cTransBin, extranonce_placeholder); + var p1 = cTransBin.slice(0, epIndex); + var p2 = cTransBin.slice(epIndex + extranonce_placeholder.length); + + this.tx = CTrans; + this.serialized = [p1, p2]; +} +GenerationTransaction.prototype = { + setExtraNonce: function(extraNonce){ + if (extraNonce.length != exports.extranonce_size){ + throw "Incorrect extranonce size"; + } + + var part1 = this.tx.vin[0]._scriptSig_template[0]; + var part2 = this.tx.vin[0]._scriptSig_template[1]; + this.tx.vin[0].scriptSig = Buffer.concat([ + part1, + extraNonce, + part2 + ]); + + } +}; + +exports.GenerationTransaction = GenerationTransaction; \ No newline at end of file diff --git a/daemon.js b/daemon.js new file mode 100644 index 0000000..cc20ad6 --- /dev/null +++ b/daemon.js @@ -0,0 +1,110 @@ +var http = require('http'); +var cp = require('child_process'); +var events = require('events'); + + +var startFailedTimeout = 120; //seconds + + +function DaemonInterface(options){ + + //private members + var _this = this; + + (function init(){ + isOnline(function(online){ + if (online) + _this.emit('online'); + else if (options.startIfOffline){ + me.start(); + emitOnline(); + } + }); + })(); + + function emitOnline(){ + var startedTime = Date.now(); + var checkFunc = function(){ + isOnline(function(online){ + if (online) + _this.emit('online'); + else if (Date.now() - startedTime < startFailedTimeout * 1000) + setTimeout(checkFunc, 2000); + else + _this.emit('startFailed'); + }); + }; + checkFunc(); + } + + function isOnline(callback){ + this.cmd('getinfo', [], function(error, result){ + if (error) + callback(false); + else + callback(true); + }); + } + + + //public members + + this.isOnline = isOnline; + + this.start = function(){ + var cmdArgs = [ + '-rpcport=' + this.options.port, + '-rpcuser=' + this.options.user, + '-rpcpassword=' + this.options.password, + '-blocknotify=' + this.options.blocknotify + ]; + var child = cp.spawn(this.options.bin, cmdArgs, { detached: true, stdio: [ 'ignore', 'ignore', 'ignore' ] }); + child.unref(); + console.log('started daemon'); + }; + + this.cmd = function(method, params, callback){ + + var requestJson = JSON.stringify({ + id: Date.now() + Math.floor(Math.random() * 10), + method: method, + params: params + }); + + var options = { + hostname: 'localhost', + port: this.options.port, + method: 'POST', + auth: this.options.user + ':' + this.options.password, + headers: { + 'Content-Length': requestJson.length + } + }; + + var req = http.request(options, function(res) { + var data = ''; + res.setEncoding('utf8'); + res.on('data', function (chunk) { + data += chunk; + }); + res.on('end', function(){ + var dataJson = JSON.parse(data); + callback(null, dataJson); + }); + }); + + req.on('error', function(e) { + if (e.code === 'ECONNREFUSED') + callback({type: 'offline', message: e.message}); + else + callback({type: 'request error', message: e.message}); + }); + + req.end(requestJson); + } + +} + +DaemonInterface.prototype.__proto__ = events.EventEmitter.prototype; + +exports.interface = DaemonInterface; \ No newline at end of file diff --git a/exampleBlockTemplate.json b/exampleBlockTemplate.json new file mode 100644 index 0000000..28c9157 --- /dev/null +++ b/exampleBlockTemplate.json @@ -0,0 +1,822 @@ +{ + "version": 1, + "previousblockhash": "24cd4c6e1cd725fe879901c3b2ee38fe3471820c4c4a10917102fa914981f65a", + "transactions": [ + { + "data": "01000000034f48fbb15b31d07a77e3c20c0db41d7719f88fed78c3769c688953b6a5e5ce9c000000004a493046022100fdd6a705f346bd35bfef1905d699920bd3cc099a44697598b911e62f1cfd1955022100eee433cda6c04d5da1ed8c72c11e15f12e144ca124f23e2853bdba32b15d28c201ffffffff6b5b42f5d13b93250c2ea7821a4db8d94e315bd80a9b86fab8554549918bc8e7010000006c493046022100c169e72d5766e6f49575ecb9d4b8f8a029450c57fc19accc114f17152f36ea960221008484890480cb7e4048fc223f122bcb5d1f63b4dc6213d10426ba29007f8fca8201210271f0f25edaea9749a15512e0d12c270086b8ac24d175ff5972037ae7522d1be5ffffffff9a8c5b9c261595ee26c81b4e58d1c0708f61bbfde7e0e9fe9f49c9b24eaeb32d0000000049483045022039553eb327d34f57c1af830d7d28f580f3713916e23676f9ae8579ea01b0eca3022100d1202b72a3358fcb58d5e64026ad888c249e8f9f816ee9e0229f4e6947fbc87d01ffffffff02cd91089e660200001976a914e03334a0c2dfc078f68c0ade2ca046749e3f82fe88ac00407a10f35a00001976a914d60254a3eb898e9cc5e043e0dd936f4adb0f9e3088ac00000000", + "hash": "9d375086ce2dcd89ddae0b2fb678761f8c30b592206bc35a5e70a031551ae701", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000002009319b7f8bcba28f2956c657564a138966e6812f336e21988d3bfc8f12cc33f010000006a47304402204f5307a4e5eb48832e1e0d1e95fbc1dea1c369b67b766ffd4167817213c4b75b02206c7da129a4cc88d3dba0ab2692abe94588cfacffd4bd378912b0fcf184bd730501210202c052a68f0130340e0c4bfe56cc4c7703ed440f02172dcf756bcd594444217dffffffffa2a98ca3d3d38b9879d28a772353d0ef91f2c033d8dc1f16423db73136be2e78010000006b48304502200664aae5b3ea33449e789d75a2440950db856379e9f268b85859d498405d2d17022100e74ad615feb529a1904c57e904acbf039a283179a5c87fabaf43c33b491db7b80121026a1cce4a70ba602a1a8504c71a74f7e9bbf338d731867d19c78c282ecb421539ffffffff01e8b2c3699e3600001976a914dea94c673f9f23d033013307a3ad944c3d2437d788ac00000000", + "hash": "a4c17d433e13d4eb6180dac68768677ba3f4e28ea1c2d99442f769c4cef02a54", + "fee": 2644328, + "depends": [], + "sigops": 1 + }, + { + "data": "0100000001b5c9da0879a3b1eacfb289bf1920f877f8475bbc276c0a8f42282bc15c0e4b85010000006c4930460221009d1356daa80fe322c94722b494c32b08b27f2077697ce2d27fcc128994bee7c40221008cce3c7729f5abed589468d851d185e22d9fce6b0091306a2f5f289f120990be012103661a771b5e1b338b2aa52eb1e34140466d07396172d284679844c4c0b781ce6cffffffff01005039278c0400001976a91492bae08c5ee041916d9438dd00de78fe3f51290d88ac00000000", + "hash": "f23ee046e265f7fa338a15d6e3d96cfa4faf545e1a2f8069b64b4e1c2db4efe8", + "fee": 0, + "depends": [], + "sigops": 1 + }, + { + "data": "010000000549213d8583770e5f47107fbc2cca44a13d4850cc8a1556d2a4929e2db90c1481010000006b483045022100a26895c10f4f1bf7c0e093883bc69b58376ad2ffb73aa7cf83fffb92b8f9c45a02204ebbf591bd738c89e80ac704cc575f156a58f1c1761be1f7b8629bfbefdbd952012102ec5a83aa6567c726e15350887e6a65f743661036e86ac406d6acc2f4b564b57efffffffff5208d7195fbd4d1ec879932203d63a7559d30e985637e4d4211a7deabf9b175010000006c493046022100e96b0dce2d2b5b8a977dd0ec3f4a73bc0a71187f7aca825927e8645e9e350f67022100d737cb9257eb7b03845147e512297736dd2e855fce2362b3b3eff79c41beaf7d0121020f4584320f5e5fc1de9dba31c707cbc4bac78dafaf6d881897e96c9a8062c062ffffffff1cdec8fc4dbe450150c8d7ea08700f763fbad7047724ae8d9235d62ddb8ac14e000000006b483045022100b8b74c4301a94c7b6b6fde0344289df9acdab90d450ce2e855673c76a14940aa022038efd131859b6ec785d4624d55d241370461cdf50f874697289a8fd9d6e89588012102f0754a4c87b7fbfacd077b0663a18539e1ba54b80701938951dfa700187bde6effffffff60e0ce5bc3afcf1ceffecca4a60de36f89b8a9c544fad48e1abe3abd10546d0d000000006b483045022100ea98f8a97b738882b2b4321fccd68e1279205a6ffc2a19c449a22eb92fdd380a022005bb54be8b3392b40b7ca87f0e506b7bcaba1fb5765b8af19740844b8d20dba5012102f5ee9ec501aeaf433930fd4e725677b6f7c988ae846864c1650882336d4454f7ffffffffcd5c337a9eaf53b8f9877d1ba59e6347eb809dbacb22eef38460dab64e466dc0010000006b483045022100ba0a1e523396b04fa3271153874e2b6b6c6e6d3c4c08543956289d35d143ddb502204520967f85ae3fe485e094e1dd93da337dee208ea9ccaa0214260b126daeb84d01210260612e1edd7a25b4903fb453a9801297f86efb50f835a396a54715979d8ac82cffffffff018008389e7e8d03001976a914dea94c673f9f23d033013307a3ad944c3d2437d788ac00000000", + "hash": "bddbbcff745b51a1d8da4f9f63a72d3f9f54f5f6fcbd344f346a1d9ced35caec", + "fee": 1005561, + "depends": [], + "sigops": 1 + }, + { + "data": "01000000020339b88cc149dc460871c676057144c95d25337a518156a7573046d8839d46a8010000006a47304402205782ae07fbf7040caa8ce117acd6744924aa2f6e9827eacf3f9dbe794f2f2f870220615e43c6f53232bd0ab58ba192b57af5d6849c5aa9ef411e83cbc5ff25a98ea2012103fb84a9e135be8d82cedbd1d79537400adf4d97c9b52e533352d99403d2ce8203ffffffff22cefa65a086686f134645415a6752909c8c6118d41fde20d4660f1cda6de8a0010000006b48304502203f2de94ff8b198ce8a3d4c19ee3c472a2d507e2eff387ddfc181eb26840a5179022100eb8f4b332ea0c00ba8f3d602a4ac2fa558c16f6a8618883f1f5948b93b524cc0012103e025b15b5b296ffb2f14c37046570e61d678d971b5368f364564e39dc9c88b40ffffffff0180898eb7ba0400001976a914ff386f7a5f6747c6b73549999794afbede5ff39288ac00000000", + "hash": "2f5b9ff8bdaaef90d3a78d598f1df9506f8729a27f560d9178adcb68f9cc1af2", + "fee": 1001634, + "depends": [], + "sigops": 1 + }, + { + "data": "01000000037c3e48c423e0bf434d8c555091f62763fd03c8e2064b46f6ecd1913cf7582f0e010000006a47304402204e56fd634e8c01397ebbf425d36c1bfe0d856ed557fcf828d2aeea2084d9f6c4022069cf9e89c4b41dcbbfd37d4d3dc32ceedfe0f9b79d680ea05b361d03691789f4012102133be627ecf7b7676c158b8dc1634063345396e86c5cf550c55645b900d844ebffffffff1fe2b6368cd203fada803b8e97700a789ee3344954875a40226e9feb66255069010000006b4830450220753ba969dec96424b2f6559e9d252a87af4d9da9406c4e4ace2287a8c48b5bed0221008be67d178fb566b079098b7b1be193076cb904d479bf54264e204ae8af35f5ae012102133be627ecf7b7676c158b8dc1634063345396e86c5cf550c55645b900d844ebffffffff8e0f60f145dd78d5452b4e62bae4ce0d9cf7f29a46a380cb6496a815f4cd3a2e010000006c49304602210083116c9da1dc48e609bc0525d3934e8f289b45e2c15e0a99e53017bb93d26bd6022100e4ac606e967852af79f9609ebd36364ebd66296ce11ed5b2b20db601579cccc8012102133be627ecf7b7676c158b8dc1634063345396e86c5cf550c55645b900d844ebffffffff0100cede7e9a2f00001976a914be545cb19ed50134f96834b60466cafedcbc382888ac00000000", + "hash": "2d201ce96a983010843fd6d6ddef806b95a60614f989f9e0b96a11fb341ca9ad", + "fee": 34918200, + "depends": [], + "sigops": 1 + }, + { + "data": "0100000002e6b6479e9197b5ae417cf306a03de720c08fed5d8846d86677d650874fd35253010000006c493046022100fc3a6fbc67bb19d18f29d113ab330357bef3b23a04e36d38a09c63214ba805d1022100cba02beb529bedfef7f64c5cae84a3af972509823e78edbcd2450a205b05e01c012102e0e57652b90415e97e71373ee18463b5bb6e49185de11c3a574e7828f3897fe6ffffffffe74b6e78d3f66fbfe0771f996bf030086c80f66717ab84d266a270889360a53f010000006a4730440220025795d4f867a2ddfc45f24933a76531db57cc5b96810e9256f42f676909f3f4022015e8f0210bbc1864f43d5a19f03f5f18628db9b576fbffe2865bd1803df5083401210253912cddda14f0fb969313b5b1f25c5ce0f8996c9d5878323d56461f5e0be583ffffffff01b8ff03208b0100001976a9145ef37118e13c73aa0c77d97c41a951dee591d56788ac00000000", + "hash": "328e70424c7b9dfecd7df9aef9a72c149a353157d6c2f3e454a53cdddade7e3b", + "fee": 1033296, + "depends": [], + "sigops": 1 + }, + { + "data": "010000000243239d17543b7a04428ea8d9ae322896c610dc23d8accf2a1c525029f83360ff010000006c493046022100e728feed82f31561f73a69556ec7b2d8cda09f7df2d2207ee100e16442d5cc2102210090d02929b064aab92e2764f2e8f383aba80c8fd154b7d1bf88ac8a705ae1837d0121025997adc40d740f16e68d8cb8e0dad749c39d66d2942da1760776a1f4d29cda93ffffffffaacaca35285a6630e1701eff42f2c9b14defaedd414eb3ea1347619b204e8811010000006b4830450220597cef1256571d8fe7d4d698f47f9801e2c0a5dfe5f6c513454787bf251af389022100ce20933c0d19883b7bc174c5832bc013105b9bb6fa1d4e5c187ae4717c1f4c25012102e96528cd0de78d1c22a8043a2334d40976f78711d7693952b8c8a46066a4291effffffff0119ac431c960000001976a914edcc0a77f03c2b8e64b00d44feaaa3a30de103aa88ac00000000", + "hash": "e5821d57ca99636f0a63f641eee192d214995d63d9b0eac58ee6ef0bff900a66", + "fee": 1441560, + "depends": [], + "sigops": 1 + }, + { + "data": "0100000002f938a496346b2690af5e1cac4b25fc7f12334b97d52621dc5600b2111532689b010000006b48304502205b98a7b43e8d74f36383e07d909719eaa970b02f50f314f2e3600d65b48611d4022100df1af5865c019590e1488f9ff0eafcb047c647d3c017466d7100930316fbaf4a012102dcb77ee988d9f68ef80f5fcdabb0ead7ed1f9393d2cbd10b7578130762fb81ccffffffffd8652a6564737334b7c5a009d9fdae23e82f2bfb47caa71fbe82f06dad16cf49010000006b48304502200ab1a41814c5408711d29902e5ec10a7cf6121393f4a134d8404683a795dd3040221009ba469555403cc98b737785f1d4425aea4fd7d0c81c2c6f4283b86d7f5616b74012102ada78969e21f35be8a65265ee7c7a290d22d9e470e16e340d99edc9669bcbcd5ffffffff01807bb7d2d20100001976a914a7b00e554d7cf97ef50ca7e49b11baeaa454dc4888ac00000000", + "hash": "621bd3702953e1c5af4d2c62a3321f0a05ab919f5ab9391bde2c56bed0c437e5", + "fee": 1868000, + "depends": [], + "sigops": 1 + }, + { + "data": "01000000011d4d21cb13f394c87d311781af7c5f3ddb011d40f68677faa34e1ced1ff6870d000000006a473044022063bd674273dc4b0ff3b0c01ab5766f3acb14bab25c1fcc093200dec147a19e4102206970ad5d8de6afdf7a2cc2eac227f311caa1831807afdb3fd7f75a1a3660078a01210229403bf29b307d1c77ef25c84877422442e51ff7f542dcaee402662f78088f93ffffffff020b5f50e6e34700001976a914685c58bd48969a27320325dcf55646c232ff27e788ac0659947e7d0000001976a914754aaa7de0607eb68e0158f1833ed25c2fe2a43288ac00000000", + "hash": "3bc87f8749954954a1a02c4ca5be34614b12ac9af574d54462d81ddf6a207d17", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000119f98ac8f98036188fdd22f651d6995eed7402cf78c124d18b65e4c5b6636d4e000000006b483045022100a47f33035ba96d24d2e4c3cc7843b908e2f585f7d1ab9b524b225087fbc7bd02022073a430db0921c4cae8f964e9942bb86e7274eea5f9bbd2b279ae686b2f9ed4bd01210334b95a51d175be5ada41c414e5a56c1fcdcc72cac44efb98ff87e64790033712ffffffff02b4fc28300d4800001976a914e50fac92fbbd7477211d0b21c6e0bc43b33f033b88ace184f3717b0000001976a914880455c76bf4bfb03a86278e408fb2ad0d4041a088ac00000000", + "hash": "818e24173321d0cc0b44df79a5195e353263c22f1e5bd06c57ca1bef32dc6ccd", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "01000000013af72cc007b8a97095866d84b3aa22cc2479818ad2f3f58f09bd3c189dd94450000000006b483045022053c513e12e71848d5b91503f129e0955846bb7db73014cfff83e4de34be14d34022100bb7c411c781613ca918b657d5b1495a089704fd126fb1fdf30a2922346352cce012102463b82eecb666bdade2879959c4daa3e7d7807dfaa6844c593e8355f05c40254ffffffff023a56a5a5234700001976a914e9a0fab555c0d433217e104282f477bf094daab588ac21f308a1a20000001976a914791886d2e2306b864e8682c827499cdc7328b65788ac00000000", + "hash": "7e22369d23169ae504758e479d2983a3e927cc38c41b40419505a4fe5ecedfe4", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000141e43a6f46df1e2be2cd17cee1a834e1157a95f4579b149fc54f26852a73deea000000006b4830450220233e66b7eee607ad20a933f31e7ddb847cd093f986f402f2971d3331fcaa9777022100cc4fa6e63bbaaa2222b0bf8535d330b23f7dd33a328dc96616ce0d05fd00da6c01210226b1b609864bae227e4734998ecb3cf6274f626609f1112055afcfeb3eae50bdffffffff02d28557d5cf3f00001976a91415c6c499878c8b94af40d70bee22eaaa716205d788ac6d4ef923cb0400001976a91488bfb3c15626fe50fe22d3efe5828fe121bc353e88ac00000000", + "hash": "d6b51993f937211b8ce820c5ec0cc4c3fe5a61f604080f18d853ec3e2a1e8b0d", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001e92b4ab97d9d38954fc204c7a1038c135ea85b230baf5688f204c572d7f31af2000000006a47304402203af6c4041ecc2c50377a9f2571af065aeeccb0b35f30302196f15913de58be0602204e026e994bdcecc24584ae269541d92e56282bdf36c38c81529e47adbd3782410121020bd94ed5dbe7bd3e79120e81a0d325ed2757584dc14072376b47ccf7a1bec17effffffff02ec0162d8ae4200001976a914024d32fe06c8665fb2d6e61aa455e451cddc5c8d88acaae91117e90000001976a9144f683c332661b560f4077f2a3229d27280b9ac8188ac00000000", + "hash": "1d7b72f5b3c88741d1a34bc4566f149290e3ad3996c85bb2d64af8fd388e73df", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001ea6864eb96bc41fd3a8d6dd9d848068b190eb7fb6213fb3773580f0447a59c5e000000006a4730440220496511e1cc98c59eadf530e96f2871c213b6a61fba4fbde6c61371b93be176d102200dc33ae8545845df82514966015557be51d70eaca05069a172a0d597c3deaac9012103632a64a763b9f34a64c3cde0c8f10033f9bbf373d958e9606213e0d20bd99d1bffffffff026fba450a554100001976a914307725953193c70e27f344a99494d76dfd3847a488ac1f419d00760000001976a91423e0335849e25c705c9cd0fbaff4386c07b40d9188ac00000000", + "hash": "05415d33ca832f701db39f8d58b7d4b4491512d0cc479272f4ec74bb75169230", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001fd13ae2d91cadedd16851fc5881adad6b15f15150024648e065cf43a7bd97532000000006b48304502204a69bb952a4793cd24491715d46c7c716fa8a055475819a8f9b480fc3fe2e127022100fdb9280c877bd2e0337a3044db248a80729bf2a3532a14c2c9b2c657f5cc3a03012103de5944bc046541ce173df0d53bb0a684313ef8911379828dd4797bcad22a98a4ffffffff02a54cb47a8f4100001976a914c90be1b5734f6555d29aa169b0516bc20905231a88acc5b55ba9760000001976a914bffff96fa22cee40e2372dc7078e6792b0540b0388ac00000000", + "hash": "aee0ccb8e6082b9684c2d5ed8f7faac806fda6561540a2bed7ec46242369013b", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001c241bc34874a187c8bda183df3aa9c8236c9668b4abb8a66d75f0d33396e5555000000006b48304502207d6a3ffb76bcf4f378db5ca7b32f23afee0e8269b940bd1a6585946d05df011c022100a212a6514dc5d9d90818c6131a290e41afb9407c0f6dc7a0bb5e22fd2106b8850121035a2364b626c6dcb1a1ecd5e1619dd3426e48d0548a380ae411d13a6c63e8e3d7ffffffff02df33938b854100001976a9144c647f308629d86e977e718fb82fe6fd2743221688acd1ed146d7f0000001976a914f88b9715ff28e4a9953eaa1203971c9d7d1a8ffc88ac00000000", + "hash": "dcbae619d2585ce33ffd97becd952269af67365a4453aa5352f9a9f653200c64", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001f1adb81ea63269ca5375cd67a8d5f5bc4aebbc6b2dc653da8b51a4d08b5c849a000000006a473044022020e95a724b88aed3244099d123b28bd8561e7c1222fe41b5bf9e74c1d39dcee7022021dc507c271451b95a524576a89ef88aa1cba88688efc0e740129c95c563721c012102a34c5296b61c2f13a5c286490c3ba4361b9277b341cd02a7916daa80cac1e96cffffffff0261918edfa63f00001976a914bad51042db3e6d49a928376646d26318e7d8917c88ac7c886ca31b0100001976a91450bba2fe50090972c821c83958c062bcab14436788ac00000000", + "hash": "fbd36439f866f5b2552c0b132b38ba401206aebc92c47e3e84b48522bfcfa68b", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001a74a76e5994180714bda66a54ace54e989a0f295756694301ee688477abd1c4a000000006c493046022100ce1c07beb62118b03d4f4b61308ef5d8661374d20fccea045bc211a116b1f54d022100fbfb0f1aa2035e487487efdfa374849e65d69954746e9850429909816bbf676c012102e4315e0efddf80fd3bc1c5e7d98ebfcc015bab0bc6f1d0daa7f375f64f2c447affffffff0203ed1b583e4000001976a914a8fe4d084f5f1401834b4fcfaa0c37479f00238788acfb57c65f020100001976a914116d76533e63d91cc0197258704c06f2f34a320488ac00000000", + "hash": "ce8609e9928da1253cdeb38bb79d9947616b3c2afbbb253d65603b2327f68755", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001f7890aaabbe5e4d9fbf7fc4bb382cd50b61d56629a104c5876b20de5d6912d86000000006b48304502201d9efec01d1a89df8c554be886725671992f191d66686988407c5456970430600221009dbebdcdea006cd6460911b11b94556a52811be59d25f7c961f5d475fcd45c17012102da090859fb88c28d878c376c021b1157650c07fcb0d097298de47a6452d89e44ffffffff02253c232a913f00001976a914b5b658ca1ee45b38edc7f6ec3fb278b847d312c688acea3028f2760000001976a91427b0fc76aebd2e269c7a36e0237776db9c23cb3688ac00000000", + "hash": "c1d97aac3421518d5ff0a901968360c0c62c52d91662d28b6413b00e6d54f599", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001d86451c17a7b5523baf45d32b7c1cb41b1ee8e861fc97d5c1234c82a36120537000000006b483045022100ee845d988fd9131b4814b0a64a3e271c6fca8ebd16e901e15bb55ec4643617e7022077aebcceccf1513165844bc9231f902e0f870a42d0853fddc9cae42146c4800e0121031794b9dd886489711ccb23e2602e37b1294abded3d93ca0ea65353c3129df2f7ffffffff0257240ab7e53c00001976a9141c68cfe1d8a88315ccf3b31c25bb059f807352e788acc2c0b62f000100001976a9149869d9fa3a1be49c9319e455a366d3ef92f2651888ac00000000", + "hash": "e10379ca1f28d6e108e2ffa42962edfdc4718fde8a8d2cb08a1fed739a021e07", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001c0c24bb24ab9e9d88be70811ec259c16c0f0693a24995edb7dd60a217012724d000000006a47304402205b75c0ae104993d64f0adfeb37b4fcf1e25342d1e061121fd509bab482dd02100220705b306bd1026903508064834373fd9e01271ba26064f815da3e2c44d96e165301210283ef3cb9a666a1f499c59afc58164734f8c22c530cc9c8d3db5fe05ede7026afffffffff02d7313ffeaf2e00001976a91489d452647a77d13a1ee918ed49725d0799e4c9e088ac69642c99000100001976a914660782957600d5fe3a92aadc91852a0d38f6bd4f88ac00000000", + "hash": "98af5f70a315219036d608c3fe61d01bd6b220b4ec9a834ab7cd055370266b80", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000115942b0a04485a59cbef48e24ff7d1b778c60b7f0c5cebe5e658c40ac3ba9241000000006c493046022100ecaa89f739dcaf43254c6651616e0d992ba57e02e4b89feca1d45e6e9a9ad5a9022100b9e2bcee0219075adc87e4c4aba4f66f97583be323dc4f732811a8626bfee512012102b9ef9b8e06cecb16d6cc86d4720ecc7c6959d0e46786cb4af2134187cdc5f8daffffffff02b4ef9dfb803900001976a914fe345204d637c59cd5975aa37fc37783101a0b0888ac40c5a25d730100001976a914d82cf865b5394539971720d7e1ac73627a025b6088ac00000000", + "hash": "27b82469cc81e059b2c8e00d332c595ae10bd91e1b0643dae3b485c67a0dfce5", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001abd3a1d51c2f53bd3cd94749e3edefe7d592ad4c8684990dfcb3db67c9cb16eb000000006c493046022100d3e047eff5ef377fe962dd769390f7239ee8b7b2d604ff57af46fcc77f263793022100abb171ad1dee91d2c16b29874378c581e9a99d42585af979e787a7a7db8dae9201210274097fec52ae5075ce1228a205fbb29467b12e24d4deb963e16506b4a9217524ffffffff02b3a10d25ca3800001976a914659912ad6fd4856060328cd4f6fe4d860b11d25e88ac7ef3ef81200100001976a914817ef65905efe009f96ba34c47fc3a098920675888ac00000000", + "hash": "23ade57b501713004ea3fdb9894076682d024b9cdf16e40a547ccf61751bb3d9", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000199be0d18dd05ec9ed519695353db2661d49dc306414fe193055542fd29521675000000006b48304502204d7881e309995726397cb4351a9014c4b9c6a7471d3640e79451c0951eeaff12022100c78a4abc2fb8a5196071064ea9afb667bb936dd62a61e795691e05c9c1879e8f0121034bb2e7feb87ad8b16a7888bf85178c4d4c23d9c71ae14f18853f7d33890cab92ffffffff0260d6e9b9e73700001976a914449f08a77e611c3d388571e686dc54c20b63f48d88acb3347a667c0000001976a91432cd2d17ad6c16cb9044e1cd39b5fe9b89562c7788ac00000000", + "hash": "6b31792f9cdeb2d73728c1715b533a10c75129a70e7ffb551709909769844596", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001238355210da232ea8b0ced5f4d5eaafaebe5362a9fb2129ba0ee28107886103b000000006c493046022100f87651020714517151c6b62201ee16ce2dd5034692a08811673a62d55c96fe04022100ef78be20302908bf82ef308d5cfc3f0c09569c3269e717f0074d0b4c8080ed8c012102d56d02dba159b2c7bbc1f1ad40a7187e15c3ba5f63f72fadebbbbfd79fab80f7ffffffff0231bfdc9a0d3700001976a9143ef4f1357c3b19795691b2ae7b9436d141ca382488acb74fcb606f0100001976a914a281501950bfdb8381ba8c8a7800a593cfab6eae88ac00000000", + "hash": "188171d4e18820758016894b5b909a4bb64dc8213b825f2617863d3787153c42", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001c1e55f2830026edae91b585c7ca9fb16ad6325d62ed9a18a20e045c4b986cb3c000000006b4830450221008dba2c9465ecc127045bebeabf98f257b5a4401e9c9302b15279de497fefe0f1022062f44e9b2cf551b1cefba4c0270216500a23d4f9145ed71039adad5f124ae6f00121034e20869ce312cec19abbe434029f05decfaee4216e7b95daaec3f000d6b094c1ffffffff0100d0ed902e0000001976a914834fd7cfc6f3ee4dc7ca8bd4ea250a2c43a7307188ac00000000", + "hash": "ea1909fe9ade5cdd4b68f49ea8ebf52b3189cae223f59b8798a66a4863009086", + "fee": 0, + "depends": [], + "sigops": 1 + }, + { + "data": "0100000001da8a29a70eaf4f7aec1d6cbfdc510bd0ab5ba8b73b18a21c6e023615f6339b1b000000006c493046022100a3b59030f8b498c1c318edc820a2727ac69ed67739d260d0ead14eac91740f1c022100bd7c1910612c9f3747893b7cba5f276a184751cef486ebccfcc9e593c822ab3d012103526de6d570931522d79fa934e82c97f8543577aadff9086d3b630c57ba46c818ffffffff029821b91be03500001976a9141362b70b2e6ad0f37dbddee85eac80a2b293ad2288acd212b982250100001976a9145b4fd56f38cb93b741da36aa9f967ecc2a41db4588ac00000000", + "hash": "7bac831749a354b1c6e379d23ad88402d3ec99783ab517a3f4e696906ca13cd8", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000172b8249f543e04f283a2c5c1ec46e172833765a4471b225ca05b30851c0e53d5000000006a47304402205fc856306596340f56fdd105aed00739d1103769bea1835d21e6fab98e180d3a022022d02146cabebadc9b1dfe7a62f3037facdb7ac50e536ab9cbc3e4139f7866c9012102c13249aacd1240373b33946c61e227e53548cd415bc33e37eb2ef2fd677084e7ffffffff024f55cb350b3200001976a914f24b5659ca3e9bdfd4a1f7f6b91f85a2ebb8abf988acb1ba0a7e7c0100001976a91478094e09c17f7ea6666f054c1c733f20b4219d8a88ac00000000", + "hash": "f0f22fb4672be4211d736a9c0a0eb2d28657dad5b692c35831e60f0f8fd6008e", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001e9fb32d9dea20c7eb15ad176984366521bfc2beb265ae02998084c71ab55b96d000000006b4830450221009eb8f33de02e56eed375233819e6c1a5b98d774d26d04ba42c723c1bb4a97c9102202583a340d0cef3184a4982336641f876043714f9133ce0d616dbf3747411210301210379e762cbab74ac11a80018f8b3e53a505b419e0333738408ed9e3102d01b8746ffffffff02a28b1fa60a3000001976a914535da9e034b53cfa6766949aea8cda599561c38f88ac7f3bfba8370100001976a914d77d3ae48bbd611ab74e785550f4e468a9874d2588ac00000000", + "hash": "ad6804162ac94696b06c6306c9ade9e48319d971f14219e453bbd563fdde69e2", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "01000000016c2f7ec242799e4b0d3ebc697af6637b1e555d087e4a6c65b79f7b489f989188000000006c493046022100b55f7cbe57075fc991b9416ad5f69e0e3af3b707ddd5e114c2ab5cac165c1264022100a6742c3069cfce028a934ca39c0ad5eee10718cd197c4638adc00a76557a9ba501210392312f7fb4ad906ed51f3bad19d6101be852a5ad15bb1782e8cb92bb5f5ddbceffffffff027c1cf0fba22d00001976a9142eb993f1a980746000b795636c0cb361a7ea3cb088ac2575ecf2fa0000001976a914f8f41d6cf479e61fd892d63a9192466eddcfd70a88ac00000000", + "hash": "4b63283c72d59c22d70719975cbce4ce98c61e94c6b0683ee184ba596469071c", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001ab302dd98b7c906cd68e246b260439f001524a4e2ac8e5f636f4fe95fc2e44f1000000006c493046022100b55da34503146bd85af082370145b3b89ac31a69bbe37c0563666e59eac5e4fb0221009d3a4f156d8a237925474e98ca61c13e14e5e4b3f3e013e335078fecf554681d012103b282d5486be02155f36b253e6ff7c5c1d60899673231799856e75bceb2b7654fffffffff0243d475a22b2c00001976a9148d16f83d08e6b5c5075e59ec56796d625a2a8fd188acb566e171b90000001976a914a5e90a58a9c7b019466e76a62df0215b1286cf1e88ac00000000", + "hash": "da7da1e45f7c11f7f5a79132e7a9c06fb958827916ca967ea98ab119c661ac8c", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001afe99f8da6b0d4e8f94435b00c816ff861988283b9619635a4d33d0353f17672010000006a47304402207f9355b33febe0f8c5516e62f31f8b68fff71cce3c52c904e4dcf1e45cc7631202203044022011edb4e79921ed6011f5b29df2023d9d6e00277d3d15a92f6f21f0880121026712273665f6dcd95981ae4b1be883b3b66bcb92cb278c3f78b55f756d173e35ffffffff0200739c03010000001976a914e23853724903d9e8d450a9b7febe29e365925f6888ac0088526a740000001976a9142449f2b55950722cdc9b7d970ec689fdddcced3d88ac00000000", + "hash": "a3ebb21fa224c878a5c92c8425c7420b3e37a0f98fb380c1ea27d2dcbc5cf47e", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001588fbcc45eb52959fd006c9948fda1424445ef701dce347f15388ba62f20cf74000000006b483045022100dffc5dad163feaf061deef2eec73840122d276be128d62563981269950a1f2a4022057a588fe7918e41e7e544112d8f55fbd0d08ec2104d92ba803f4d4b0c5db42250121037fd4443fcfe65e677434952aa692a5293b640addd4901d60a6e1d5280b022de1ffffffff02df859bc3a82500001976a914a4acffe851b394e84ec4a104597d8e9517beb62588acaf55e468f10000001976a914a8d73687dfd749bd897c96a4bc8f9fae827dbd8a88ac00000000", + "hash": "bf7094b2e01a7344b8e672bd91806950a122205f5792816079f3a88011e7988e", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001e7a68a57e15a14ca5eb1c2108dceec02889959a3e413bb27ab5af16eb52fc086000000006a47304402200e30ab495a3a91de8c385e2802974eaf93b3ccb57797cadcc6cf551576fc4737022045df7793883baf2a98f0a87ca12022c4cff6c510d9475304c0a42f7077a09d6e0121034b57b74bc8c77ad93c41821d942f21d3ff8aaf9f3c1026dae2859d39ad8adeb9ffffffff02c49c7777ab2100001976a9149f31016111b0eae70b97f2ca387478e1f052eefa88ac9dea2cd2f40000001976a9146c751e6a0e07ef59ca98f493cac66bfcc5183def88ac00000000", + "hash": "fb45789476cbccecaa40b86f45e58bcc969e41ef6227f4cf5f954ffa34b88c01", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "01000000015d4b7534a614faffdba91b27b72f42e9e5f3b6fa65948f9f83d75c536d818e13000000006a473044022063907c34a42a3af0d90b73030dc1a578a66e2bcc454702b7a3e62ff6448e44710220160cb825bfb677422db3b15dc6c5ca524a16d63610ae5003ffffe01366de97f50121027b0bbba5d3428d75ea7aa1d3d989a14e82cf813ea52cfb2f57271138d1765a41ffffffff02f830ea8fdd1f00001976a9140ae3245f3085673da16a245df634aa80690628b888aca889255eeb0000001976a9143c3a79e739b243ebdb999b15081f5e74f9be3f7788ac00000000", + "hash": "1a8b47be0285b4eb88004abc090269455b75f4b5e70d82d094cbfa7aa44c6c0d", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001ac177f7d9b53d6d1504e6fac20b9f6089439bbc6387419374d7bd72986bdf4b0000000006c493046022100b47eb9a9b8f3961de1fee80c4703894fa1e8bfc1cc0a8b592337f45f15c7cf71022100be3cfbbaed75769fb87832a18bd02946a70e9491be54a376c9672851a8e9178b012103f060d4480dba0b63e59cb05febea187c9a1b1a54551ae9b8d0426529fd68a971ffffffff026e91fecf1e2000001976a914142550a2414d6e560f0411e25f2bb402ead0fa0388ac107aa1fae90000001976a914a8d73687dfd749bd897c96a4bc8f9fae827dbd8a88ac00000000", + "hash": "11bd75dd5c15bfc7389f5ba20e93bb3306e5fbe00c4b6dbd196b6136972b6804", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001e98bfc23a4a40fba2e24f6f43182f8f725def2ae1a15d7599d4edd6e95a4e7ce000000006b48304502200c2e5be0e94acafef75af3b5bf6e3ac66b7cc628d0a05e4b31d5812450d617130221008145c672921b38378b7f3b2bf8ef3f4e377e1352c399baa1d27842b03e471fe00121029968e1aec778eb430414de1a0d44146b3fe0af97aefeea145149d50c379acb76ffffffff02ca7a02d2d81c00001976a914b4a6936d93fa2994bcfbdd51a63c8c3815215cf088aca99da871eb0000001976a914fe37b1f921981b186d012013e0f35baddcfafb5788ac00000000", + "hash": "31047728577aa11f6729997f7bc7a3995180853eede8ce50e13d8b8a39eb1225", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "01000000014ee1be44d554abf500f3167c2c8123a2014e0b209db93abd50f6306b5547fc82000000006b483045022100c000575729b1d7bb0ffac8ec973324e7022819ed2e9de9a6aaef2fc2142abbfa022036c082ff640cbb37a225deb15b508e2bf20e4e54f4af169d44c25f4f58f8b90f012102d48ace96fa4a2f0c994824c32fe563ced8949fd939c760581770102698415d53ffffffff0213d5ecb4912600001976a914db94cf1895e0e02bcca992f7cb9e291e10b466e188ac28145c8ae90100001976a914dc9dbd31232e8efef193cd2d165c92d3dc1896f888ac00000000", + "hash": "7d17c37546279092e35d65289737068e3cc49606d77f35c0caf6d776c63a379e", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000186bd7ca5cd1bd8d5435a37dec8353ac8b029ac4864ba2335acf7505eebe0c14f000000006a47304402201508257084b9dd3a73407f38070df1b345c6b71196080cd927f319dcd883013d0220729b71ea946ee8a5c545c5596c70379cf436e1fe3370fedafe907f2c7acf939e0121039ee5f21cbccebc3ab8c2561df8f16f5d79b49f6e6ad31a14266434c5aadccf31ffffffff028cb98856542700001976a914396800021a32a8e614f7f7e70efa60a7e1bfe58488accafcfbf3e90000001976a914002d6f13d20e6a7c9cb5d2e705e7ac20b805e81088ac00000000", + "hash": "5e732b1c29e8638c5f549e7c4305c033b7ea01277db7716788edce8aceaa2fc2", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000104a8c770903cf05c66e3ceb49b972a7bb87780313098360fff349dfca7f7b681000000006c4930460221009cfa7b6ba5b129d5a537cfb1d53b8d43d29d6cde3a59e71c9823e21cc3c3abfd022100f936cbee885367a992ac28427a4a028b9c29505455c0d82141566d90ac6b8af8012103d04a8e727295640ca0334aaff0cec9c01fc92a414ab3e128302f77158e622acdffffffff024d40b542a51600001976a914ab2dada114e669b96f742f11aec3eeec81e8949a88ac413f1427f80100001976a914579704dfb8328bd539f3b348c6910c54adc1cb9688ac00000000", + "hash": "7fd5b7b31dc5650183a9207809c05ac5178612e610a069c01ea6c9d52d2caac1", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "01000000013a3da9aff3c7d93715baa49259a89801f01e9bcb374129a26309c63e9fce2551000000006b4830450220474975251d5f2a04a98c034c7dcf40b485f2ce74904b7df0b28fadd814d40cea02210091c1119ed439f4749ccfc1f10f2e9ad353f6f7dc11c18c6252567a934704f87b01210343f641ec310d250c7b0444e5811e64bb6355517a0c09416c093d02dfa64cd841ffffffff02f7152adca01700001976a914717e5fe6f57d8b76a3d17afcb4afca60f20bd7a588acddf2a62eac0000001976a914955d4168c18edea6e1bf9c95464b918b2882ec3288ac00000000", + "hash": "7ae8e80fe7eee9d1c6b6ff8b7d5d10ba7578fb9d9eb933e084cf66d5aa0ee8bf", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001407b907b3d299502f4e8325420b4205bdc7266033baaf17780312946f0d67b97000000006a473044022043652cf34c550188d9400659d8cbbf4d3cfc61c8da0238e254f303e8c82a265302206005c2e8c87b454529d30c5657714ae8cd346437d269a01a27e8c7189f40a8cc0121036fd05e06bd5c120d5c617c45c73488ba1603211ef75b784616b7aee210f41e8bffffffff02f4287556da2500001976a914c55cb12795a952aba82f2a1f0f51bd7191b6e6b388ac7eeaf38b760000001976a9147d787427560a3cb9e135e2a79b4ccee33acdc86188ac00000000", + "hash": "33309542556ed6a6af76c24d1bc0d5077f380a9033bf0a6a7371e7029abbcd3e", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001806434cdfc2745255011505fb14239330c22c225510e9ff0b20a0f3fe5058a38000000006a47304402204de41d4d58d05e4157349be3d2993eacc6490c5de5a891bb67aa7e45c30fab8b0220310121766f26c7a810659067a3960921d830c8241bfeefd1e17a8c98406a673d0121029992e8ef0db7391f606bcac28e6329d11dff746585d51ae003fdefa61a022a1dffffffff02304719f63a2500001976a914a75a4a56bfc2c8beb4c87eb029374174df71999c88ac91723e40140100001976a91475b5f29ef42bbc7e38225fc26694d90998d6556888ac00000000", + "hash": "c0be42deea04f6f8d7c9c5f4a6097782c591e9dc3b5e95de8d14bf611ca2887a", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001f5af07ea0b6291786771d8f0980d91b45b72cf00baed680f9bc923699af4bb78000000006b483045022100fd731ffdc458701f35a7a80346938be08b1f21d1a743c311f336a574b1837114022016673726a4880766292a6bf55272c4d1a875025a3f9c10d758d6986d3c66998b0121034442ceca76d6c081a0a6d9d103280b2aa8bd20eb4c37f34f79ba330d448e4901ffffffff02f5d88f38a62400001976a914531e0ed14956536edf007b4066abf98c826f753188ac1c1357ad780000001976a914ca377ea4a66879ccd1d338021fecd4191818bee488ac00000000", + "hash": "ed9997aae6173ade28c976baa7607e7f77caea4f23ff65e03369cd33f4c1571f", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "01000000012dc95c2824439cc6e6185ff654409512f7c5d34faee24254ec0da12eff9be83e010000006a47304402204fe9aa8244337fa5dd1b8d18eeda57b68304bbe6b52d7cbde36eb031d1ffae8202206314997a0ed1765d312b75af2c4cfecaa6686d28f2a0229793bba1d1a052bfb6012103e031d8551d70b6c9aba11166c7d859aaca964ef792449d81719e33957b666073ffffffff02d32c83a8020000001976a91490ff0926082c5bc615e354619644f90bb0bc968d88ac00205fa0120000001976a9147d422d6bdc08f221e938650b58dd0ca5708dc5c488ac00000000", + "hash": "ae3eb8ed5d7ca5da2056c644f0bd51ea3ede115e06f7858b60fd9ee48956e8b2", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000173d22e19b9a62916e1a0e74fbe7dd2d8e0d6745e5d43abeb598b0e368b791713010000006b483045022024606b38c26934236422ccafdf28e5f5875f554b3d04e1901a359217488ff9bc022100b9aa9263c8e659dff43957e3246c2fe5dfa6664394c001ba4b7b70b32c595602012102f752f2c13783bb8b159a1452e4a8054e10794f6f26113fa2971b8e8b0cdcd7b4ffffffff023bdede301a0200001976a91482711b52312932173230dd7c546810bcb7ec336888ac005039278c0400001976a91476a136d77a642e956bd04b338fe3523e2c6e48fe88ac00000000", + "hash": "a97e4bc68991ba6466be62edcc5dcf7811a0121bdcaaecb055dc2fb85c4a3ed0", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "01000000015f666a7b83f1b55aca12f0a54fa4596b1551c728a435b0505af7deceb29eb2c4000000006b48304502203f4026845925fb0b76b7ca331c01f185934b71eaeac896729f6f1114d972d12402210080214ca9284222561a03af279cba70913892f3097f377b60f46782cf59fa6231012103a3efe1b6320758b7acea4c3146657e39ebe3127d5ca0286b4be23c1f8c967503ffffffff0200868f20e70a00001976a9141cfa875ef4225f6a411f5e44ed2be07bc81986b288ac00ca9a3b000000001976a9141e649c6e0b6b26fefec52d2c805e09226deee50a88ac00000000", + "hash": "e3d01daf50c0f3213399013f78b1cb376067594e521518b0be91b5cf9247fc12", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000194fb6ce98d9a75774b74599c6fcf351435db0d69eaaac5d8387ad1ab2f5b4bbc000000006a47304402200283e81875263db27ef4152030bec285be81853fc54f1c749831132155e32bc6022003f0f60aeb3a799a09f3caa643c294045dbc9a4d03d4109636f3dff92822bd5601210223487670e5945ce786ec6b443db040cfea25530b2893c5ad020b5d43bc8e9dfbffffffff02ec069537ec0b00001976a91413f734c2a0b36205dfabe29cb10ff21a23833bd288ac064c957b5f0000001976a914b58b8f90d06af262383eaefd83a06877906e0aa088ac00000000", + "hash": "c15cd38f506f59b139c53289e82d4ca04ec960c422ec59495c8e288ac3be81c0", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001dba07af71fe21eb6da743241042fa0496a460ae5b0e23922c8e59ebe198508c8000000006c493046022100e47764e56281971c9e6562cba6ab41ab3cf1f2b352c4d2bedd84effb1c16976c022100c999c01d42470e9b90bdc00785361845d9705fbbfeb2de362fd1a3b9e93816870121027edfc06a69446b39865f69c2ba99d767a3dfddbd4c8afa5f6371d5a6702d5122ffffffff020f629be1903801001976a914a6034716d4920f1f70d9826eb93a7f9c30ee5b3288ac52058427fe0000001976a91432b81e341f5ab8dcfd40e469bf258a83e38c450e88ac00000000", + "hash": "cff3a459940e273f36c483b37a9779a0af452e602785dfd7a6e207d3631a0468", + "fee": 10000, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001b864aea48b362fb3e90bd7e5c2fe87cfcddc0cf401a6bc8d29dc61ee450f64aa000000006c493046022100a87528a9486c7010d89f3eab5656e56b0d6183d40f53f7bdb5e669c8a71d26830221009770a39414a987a34d49cd56068cb63ef069116d06e3b980688421969ed41f9f012103bb48adb56588de202a273a67f5b0c7f77010a39f9050d4158b30f52f86f8dc04ffffffff02279328edd20000001976a9144e164a866bf8eb58e5221fcf6da63d53bd95c64f88ac005039278c0400001976a914dda90e98d447f94a7089e0b3c7687b76571160ed88ac00000000", + "hash": "5cf23caa50699a711d6c386fe5ac277e4f662ba0efe964d56afe9495163bd8b0", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001377e0dc17452e2b70fe5433f28e2b5b029df815e6100d501d740ee0d67933de0000000006c493046022100bf146e70653abf82b2eff4db214a0c7cf9684df20a210fe89ddd3a68f672dd06022100d468b6daecf950ef9b0b26f08b788116f32174def076ec823404dbbd6f5c5d63012103000bc6a0a52236aee830a0eb00af15c69721d6bb90353bc759703c0857bba0bdffffffff024baa3d448f0d00001976a9149cb905c8853eac0c62d99e32c1b4d77d20abbcf288aca88a1840810200001976a914f6dff1eeba6fa798d91271ed964ed074c1f914a788ac00000000", + "hash": "9e68ede5b5d568e84e8de7f6a9df744ab6ad9b83302e61d11d607097e38ad828", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001b04011151527004680254a05821f80732c709084fa8f424ff95dd4dbd898a27c000000006c4930460221008af353151512c4d23394b7fc2a08c83738d0132ceb90fdb5ab6cd27b50a20a33022100ea1675e76c9172038adc21eb4da7d2917331343173c4ceffc89666ed7d0c3ad601210258ecc555cf9818bd1c2a3e93761b7d5a6f8147e4b61e74d00027912fa707d671ffffffff029f3f9183ca2000001976a9146c1d2f73b38a201cc2d63cfe31cffe5c827397f588ac45d2956a370000001976a914f6675354702ba786a61a9a1df7609d21831de53a88ac00000000", + "hash": "d6859f3a5add88241ab187934cb21f62cde02402ccc6520542b2a65be3016534", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000104b09106ca4063c5d418c666fe8f3741679595f2a2d669bb9fc589860852884a000000006b48304502206f06f07cb688cedccfff01264e3463357ba0384e669e71761be2a177a20b1073022100fa08e706f66149978dc7ad57bd6fe6054e4bb6207f164542cf06b064827078610121026ef4bb59b757ab5d6ee9e8b37354729cd335b271ada634371030328ed88f6c82ffffffff0243d1cb4bf10d00001976a9149e7bc674be83a0ff805a6cd4d1ed2e79b920ac7c88ac640f93c4e90000001976a914384451a91b363cd7d22c61a67af71c0da58a771f88ac00000000", + "hash": "4cbd9c982ef1e013ce6a4b71187acb91ff6df81bcd1babd2dec8639b346ca7b0", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001c5acbd09b27303be8472423fd74f81f280f2fefb19252645211809e489ca42c7000000006b48304502206e5a92f94970712c1c80976bdd954b4a0485c54080c36f1464e0416004b4d4630221009644c0a4f3fec418eec6a2bd8183ea2c60705704c20b1449b981e95f7468bd6101210335aa14f1b2b88c25b578dff26759aa819f1728852bfff0e123576904648a39e4ffffffff0262f23301c70800001976a914c9f8ab65e3a0005fad9e97892a66410dbf0f005588acde31f900d60000001976a9146c16c6b25646c3bc4b3a90849bf65ecd51f6f74988ac00000000", + "hash": "a58be917e268120e18b9ae43854cbc41929d82fec8bc8cf7fb153e0e3443fe83", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000004bb362d41cd433c0bf652e3e26519100ff5608d5d62fe424d3593d764a9571a8e010000006a47304402202083f4b063ee80dd7c9a3c1ede6fca35214276e39163813ccc3fbc80c2debd3802204623fdc8d4c8b5a61dc2213457670526218a049ec740f74e109aa89ab375e1af0121023d5d72a89b830a013d6a8b0086511a9b2ae24aba1c52d509000add165dd74b3bffffffff4c5aa3e4b9e9b92b987defea4bd50838009a5429a75c60783ca22be9bbfa24a7010000006a4730440220683734c3adda51fbd885369bee706f3398837654dd3ebe7bfb870947eb88cb57022003256a9ff365853b7c88ff03fcc2de360529ef2052f06022c395cd752c38fcdb0121023d5d72a89b830a013d6a8b0086511a9b2ae24aba1c52d509000add165dd74b3bffffffffd91c459f258d38d9646faf09f99816785306b4bdf4ee5bb8599aa7b50088821a010000006b48304502210098591aea3c66658dac078a926d1463004b893f26d44f82dd1defea31e92618ed0220357a176c55640731b32fb9e58097b79895fbef508c70b0ed297fcef86e616caa0121023d5d72a89b830a013d6a8b0086511a9b2ae24aba1c52d509000add165dd74b3bffffffffd7e4e5e2e087fd0db001d4074b8245395a21ae99227c3896a7e0385c72cd3a77010000006a473044022032afe8cf361ea4b6a27042dd42ce57e21713733215e8045d3a7e6ec94575bab80220060ce55992da8b3b7029e8654f7839103161dbd8b40fae90dc868a0efcd48d980121023d5d72a89b830a013d6a8b0086511a9b2ae24aba1c52d509000add165dd74b3bffffffff0200d0ed902e0000001976a91447d648c1372f238cb401493ee04e8045f79a8cbb88ac46a2223e040000001976a914b55b7fb7062850b744cae927d4be19fb05130dda88ac00000000", + "hash": "99d3ff3bd9b638016bb4b652bab857c30b32733c1b2357a297fc0c42af801404", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001dae1a11e26dbc86b83394054d64c012e533396babcaf59d766ef28f8e011f224010000006b483045022100a1b6e2bee0b73ff1470a4239828b66847f41c4dce43a852584b506a755075ba10220756b835cd97dd24092972ccab01b742575ee262aec5694f2a12795b4e298972c01210227bc97b1fb48cadc4a5dd1473183b5c96a89145353917c0f84b82a1d0af17033ffffffff0200901a59c80100001976a91489444ba5899b7dddb6c55cf78a2cbf292b5de4f188ac00902f50090000001976a9142a4b298f3e22f874f6596f145a7f302bd8e9403488ac00000000", + "hash": "d7f35f5a3ff214453bb3e84ae884381b6ea84a30e6a8bbf94d6e986ed6d650d4", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001cffbeb4fe5617c1730eaddcc7691df1623f71542bebe20ee17f0ad047a3e41d9010000006a47304402201f100e0843ff42439f5f33c2245c7879e361e4b2a6eebf67438d6c262003ef05022031ca6a76d8ae77cab4bc9122288b70015c8740423d80ae324a3e25f55a88a828012103e031d8551d70b6c9aba11166c7d859aaca964ef792449d81719e33957b666073ffffffff029c6cd030000000001976a914ed48d2471e0bc327f70a4d4f5fbac03817566ca088ac00902f50090000001976a91446f5c4cb5f59e029aa795f308f058c6d3a97c1bd88ac00000000", + "hash": "95d52e311a71c044013050ad293193b20bc51c6a1a28fd4436b263e9beaddf37", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "010000001f29660f4ecf3d48dbb86cafad59103283d2485163ba43cfc5b1a2082f669c506c010000006c493046022100fa1851c690e2efef91489fc2630143691ab95610b4940ef15268da22ea0ab10d022100e3fe269240ad760955bc4fdec07a3bde4a922293ec0401431d8b333479c5a2a301210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff35d701ac15d53c9ec43bf2d65daabedddfbfb88e2e94cb3e30269d235ecca2ae010000006b48304502210082d77f37982f2355bdeffa3e1a94e106b1fa358cb94ebe7546719116f9960ae0022044e58a6bf0c50a0bea43bc229e17c6b12ab2ec9258d52941a85f859635f4bd9401210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff360d2826bee77cb6852b6241c179fb08b701551d226220d5429818dcbc84ee8c010000006c493046022100e9da6b0f4de967652c4db5fdcf8bf35c2709fb28af425b8ff723a5d80ea85a4202210080dde7274e7cfd0fed0c7effeb9708050154c2ec21091ace70a01acf464320b001210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff0cc6afaf9dfa06a08b561d48d05abc4c29f11de7ac332210a52d17d624e9c1f2010000006b483045022100a2a877c08b1e7d6cd5d60aca8ddfb7fe36bdbfe70fde4b569fe6ba1e8111d1f702205d99efb9ea47be9ef36d6ecf439a8a79d199b5d9be6640b1c58e7293ccd7b76b01210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff2535c551032c6d763f3b5789ec6b437ea7ca8ac75e2184d716a19b2fcbcd6872010000006a47304402204bead0b201ba4aa4b03d99243b025ccb4ba60056a4e25c7b45b530e1f897358c02206405c7f1c6078b77fc174d9f4b53ca28aec2a1d9620e054cef1eb30411e6d68f01210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff0bdfd1927727335fd71537cdb8d8078ae6429b3eadec7fb4cc35108918a01cd8010000006b483045022063a9755aeb95e61e640577f508a9e1d06c4387e7e6c0350fc2d4850e2056b1ad02210080b59bcebb0be010367df084d7f94fc4900bbcb73247ee01aeb688787808d60201210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff1690e5b1932ac1cc80f61b15493bd4255d810587b248af36a2642950977bbe82010000006b48304502207750dfb4b0e1a72dc79c76d47b7740e4e85dab96afe99adae2afae9b9ff53973022100f17952d5a8385cc10214574f2657c97c270a7630bae31a276ccab6c792211be201210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2fffffffff811081b9980bb06712298cd2fd2835beaaf7651127f7186aa71431b5f3f5610010000006b4830450221008c4a4b07670e53307f30e1a41c0bfd9f39696c65da15caf486c291ca94c17b7d02205f7be6051d10c2b7273eee13833eb10dcd76911006736afc022a226583b0abb401210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff8b8ec82f22da18281e789cbd3db814acc09a4fe15b240bff916656c5beb0bee0010000006c493046022100c0a54a1ec630ac403d42f2afea78d0664117e04389ad76ac64c2321f7b6a6177022100ef5d12d00a2b95a9b7855abccc26d47a30ca9f93441ef00339d6ad146915a04c01210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff8fead2466148de7db1e628576e35488c3a84d127742584f2a97e97ad436e9497010000006b483045022100ccfc58b9d1ad9c207e8ea5186564d5f23030e4d3c0124cb29f1e5ab2a73d547d02200192ad4330f31f7dce6c6d636e209c54547608251e44edfaba1bcf40d6a7e13901210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffffec275351703bb7df9cb9c5d51591dd0f5cbecfd4ed6dba34a00f7ab36028fabb010000006a47304402206bc6c8f472f4e4630cd095add0bfe1b01fc45deccc4635e426c6cae31eb8a0c00220293fe1a41f5484c53069d3fa41f46f584a0911d4d5a341ae54c842551d4a7b2001210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffffe9ce09e0dd7fca14f3a22f9e6ed536133e880188eb989cb7e2db2126e78af2f1010000006b48304502204bfb357c41bd0e43e1de6d0f6fb58d40ee020d4f5926877157a8aa99e3b5fab4022100c1b7c00c9b5ea900bd0e12e00288b57cb164b6dbaf1fc5a219ab4d6b8b7c5a7601210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff93e5618c37be24534e3e07e8d8afc01ff15e6e9049a3bfec3c24bc5cad4ab26a010000006a473044022031a4bc1b81b2a4720d481ae046361ffb2bb3afe643504b1051050cc4644ed7c30220164089f6ac86ea354e85451e9131a68663c2a25665667f564f4a89b562e31b7701210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff0c41078a3c24e4f245bbacd9b528d248379d3db7b5b0bd90deab024bbaeb63f5010000006c493046022100c8a5eebd6c6d92f298d90162b2239e0f12c5beb937ae0a5a357570d5ea853cfb022100c220fd5a0447f9afad2030d22aaca52e82c1aea191b3f5e2ffba95f801db313101210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff83063fb22af3915b8794ca117995a61dec8042bec3961617bcaefedfab6625d5010000006b4830450220341a69e1c8b49bbf14cd4933280dd09133581b8039ebd68e21793fb6d1aac236022100c12977a7250df69061022e46ea1e45a9e1ce6bef4b1a26f60c793d59f4c5923401210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff9c0ea0d93e7a9bbfc0578e37d672291f432e8249c25fae9651a11e5d7f94277b010000006a4730440220458d53d031cdd212cf333bf4c5ae832fbc603afdd6a3ec565a644e575b41b9ff02206d331f50d7cf3c6609a6d1609335ebb2b7a14298fea568c960ea37cca434399c01210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffffa303689350014bda3502ce65f1480597f1f8761bfa3e4c8cc87a675db8de887d010000006b483045022100b596dbafb5b3cbb184a71ee9cf92d2c0db6ccd05b4fdd2f1b4cb95741af8307f02202521b2de25f8ffe03c45fff8e85c0ad232da57228720a4e18f2beea96f3ea93601210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff44c0b2303c2e41dd0f0ca5e96343c034481c923277c402dd4ed1fff5e125a34a010000006a47304402205ce1216a5293b20fee60a39d52777ee804c5ecf43f211a07b6f970bd424768d20220716dc0d953775b7f5c86c01fd68ce023135d6dde65de69dc22b21b60c3b0911201210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffffc40a701123cc6ff7b722b19b469e8fb3790b8d798e0906a0c12225a6dce95b32010000006a4730440220114dad174a7b881de0d53fef1ba3f1742d0b3597e25a576dc62c2be33be2ecd3022058a26754c1d5d79cb966eac220c77ed1920577a0e17f2bdd1ed8bb93eeeddf7b01210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff65a0d87f0fc892431a09d8710f7d1afbc8fb3695f8ba90a3ed3153e7dabfe820010000006a47304402207cafc217644a83f80504e47b1e349bdc7a67fedfa5616e68c30588449bbd423802201139d115785373184c36977a6105542fa140a94b57c9ba99aeb153eac2347dd301210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffffe2b18ff15658c5ad7fc8784f7a477285a4a5b1ec9ef5cc5cbd75e8131be7cade010000006c493046022100814612ce2df28f674c4f6838ac313fab66e3898d40a46c58333d42db24b9d9000221008c8e752e3e67e4bafe192ef7b44645495d2a2bf9b6edd2ec15126304cfebbecd01210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffffbbb734076764f45def6c529d877a58dc90ec54f6c845124b2ae5055a89ec35d2010000006b483045022100de1b7165d8d1cd2a6121c0ad87290a06eb7faf8520306e5981f595f43cf21558022035e53fa79b0177fc67e45bb180e15b8bb3dcd4c7769529c0aeb030e3a395f2a001210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff3ce59b8163320f11c17f12922e1a56c72cd08100763230afdf2bfe33a26e9d0b010000006b483045022100f79935b6b80c4cc3e37d31cb4c4d6be223d582edbcbfdfca321232a25a4ff26c02200dee3bcc3384e1f1ca141e92e136dd0d7afef8a4c18c28da6880d1e0a369a22801210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff63236e8fb6a953c3be191619939f909f2e20c8e713d5657c5b354b3e0fb47ad5010000006a4730440220180b764be8ac963f4cb94c37dbd8ba629fc8e3a92117b3729c2739ccdefee10f02205f3f195d80c5f94c59b380f287bdf1ca702e25ac9da3d277962770c50ab3d81d01210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff786263de226197f0c6ee9ab02227eaca0900643c13bf0196d9e5a3b2b24ff034010000006c493046022100a51b09193725f2f800b25e8d376f43d78f0d41cd22f63648376f36b5c0feca72022100a46288deeba7646ac8963376ca66b6175976b7116a55c106e73c6611a68f101501210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff463629188551fb3d04ec444c49c405ff32b045f7a91a145d12cc35dc8d15512a010000006c493046022100d5caeda43fbbe7ce4a5ea465dcc3a0d1ffcfa81961f5002d0e22b51d318f4fca022100eb80eca91b1de330c756f1c9dac25e994df9ee53ed5df53a816c6f01a9016fda01210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffffd77673b34e429a3f270d8f78cabc68f470475e84a2818bd20a7584df7193061c010000006a47304402201b38e771990f258c1e716f91ccf15a34951ad2e6666fca563d7ba58273b06de802201a0ecf64f05fce99ba574505508b98ba184c50c4605ed4e05063b23d059dc52d01210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff8e54c49b1c255739d0dfe2db14ed0904960c07ff86b1b7bea80259c56d479496010000006b48304502204e10e867967ee64bc98cbdd3247c4da9f19bc5cd885c5889eab55608379eb649022100956c8c08541b22f85442503a9af0906ded1118916ee05181216ff11255eeb6e401210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2fffffffffe9d3aedfef202a4e99861fce945242e1b9a46b405e8506088b8aed2ddbbb57e010000006c493046022100dd6165916bc9cc90f27a8d6567900c5b8c5014ccc4598ce15c8d1451dfb65b19022100a61f909a867761337618f7b06874dd33799880d33a782408761ae4c74dddaeeb01210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffffe125c2765f767b5325e62d1a276421d8624aa90163357bec4003713294922117010000006b483045022100922abcd7dbddca6f081b9905e60d7951fd70f07dc207703a6b83d75727ec613c02205122d240cdb623342782b98724b7af14aa6e481dcec9e1d316171ebab43eeda201210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffffc53d8f683472c76370108661b4bb318a65bc0c1f1a6e58865a8f1ee7e07dda53010000006b48304502206326c70cd401c894051a26ecea26016ef0eaa68382da73ca08cb48cef30d633a022100c779fa96a8776515d8853b6276e27cc57f36fb93ded2853a3c7680cc1fe5728e01210342def1c2385c87c125f1bdba8fe1229349a665a58406e56a55406623b11706b2ffffffff0266b4d5b8000000001976a9147fed5bd71208358ccf2c5a43c97b2cb281bcf92d88ac0010a5d4e80000001976a9142ea2f60d9db1f93c5b19ee8b9e15d02c3c99090088ac00000000", + "hash": "118bccf57f0f8d26b295bff665b41fa7e577405a58767e8c8cc3f6db5d3bd8cb", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000194b974582d68b56f3046d35d269f3a65f8ba43abbb24425a076ff374893a9afa000000006b483045022100fd04435c7b1cbe9589b469c8ebfd533f7e537ac04a33c2823f948760de6ee1020220420366e7078c2c239954092898a51aca51ee1933eea9c5700d0bbbfa04da023e0121035c392586f88a469824934784a6518fc8287e8874db9e6e89c57a0e356824f625ffffffff028d024e985a1e00001976a9140f0d0e7a0d17c72e0543768a8189bc922b96d8c588ac76b1b7c8010000001976a914d5f5173683e1305c10b34c7384d4752434cfa7c988ac00000000", + "hash": "6d908171858089559240339766cd2787486c7d62cd0ea700dd2d3653d9159eed", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001d38bdea78de6223a6710a40d37673c7d063044ca0965f40e18de2f3190784350000000006b483045022100e8e7b583fe36a86ea48ec220287309d46f0c400f053812809a4fffeb7bc7eef402206ec5bcd169d220c7b3926b4f96545014aa77cef35466630dd708526ef5de58e5012102f529cdb597c0962d5ff6c7e84085da9ced3d2faee491dfe6b7487c24db3804edffffffff02629ae9bd8f1600001976a91498a23b553c3b1462079c833c3500ebbad1894ca088ac38a43902110000001976a914a85d6a57a91a77c09353ce7f9083f8abcbb2129b88ac00000000", + "hash": "1a5eea212860494bd8f9559dd2412f868e15c65f673edb120d778df68f4002c1", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001d0b3387f2c5a982812ee82ccd97372545c88c3f922b9f5b1af28cf8c20cbed9b000000006c493046022100a051a4e5d7224d198551d14b3aa78eff49ff7a580e98d4c364f951bda4c5add8022100a6fd72af3794b689defbc460418386e3dd720108160778bc19cf419e375415e101210201b9d99d5e54a4edb9388701ec8c93ec9177ed0b7616b6548e22fb875e0eb651ffffffff0200b8b948040000001976a914bb613437b9a9af6b91625ecfdd807dbdcbb415ba88ac00ba1dd2050000001976a914492ebdd7345472201a01569cd8e7024b2fc7698088ac00000000", + "hash": "125f71c5793d3a03648f3283892644caba8ba11625994e386d06edc739bcf08c", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000733c0a3dc72f523deaefbe16e235b8d49daa64b41163f30870572a1498babecd6000000006a47304402207dea9fe8ef117f34e0217917bc20fdbab77e4c73006167fef3e4625619ea1bb8022061fc4c8bbe818b247c24c49d56607369b3c7aadcf540d99d690638bde9a586c90121025fd66f0f3b8c88819d419b0f0f79bffbcc4a580fa9352233694571ce44cdfd06ffffffff559138580340fa08b4943a80ac40db2d894c0ff1e67c652d8d5baf1938b91d7f010000006b4830450221008a2341c1708171219c022b56444b892c588892c832af593b80b7a4811668ae0402202289070744465480e198c7c276b63af4ab84c8cfe3e48ac381806122d1e0e2f40121034e20869ce312cec19abbe434029f05decfaee4216e7b95daaec3f000d6b094c1ffffffff5b16ca5002e1b11f57000c23de66f918f8836f3737fe2ba508f7723405dbd70c000000006a47304402207a904a72326d830b7d37c498214ad8cdf7f7290227c729a762ef47d238d8f5ba0220710127221e555d87b3caf40d931da1996f9f24ac1b0bfd91322631f9807d04f7012103075f144961b419047546891cf56fd3b011b5d41e48c938b83461caf406728c75ffffffffd916e6af2b92ffd23313972dfb7d0442a32a96f437fe1a9f0ee699ac08031997000000006b48304502206e9f7846b3fa369e1fde01efd18d02494c74b4a3bba408a3cca7b042031e37d4022100a209386a9fce819841804ce554595cadc91224224d2a044521c30141e1b03a5f0121024c2ec920b3f9c40ec4eca0c03d56083c7ace83ea76bda34f21edd226e170e8c4ffffffffe83570587aadbcbba96ab30dee87a657813eaa35c50cfbd7fce40efed755b864000000006a47304402204c4fc01567945473b79b5549374ab7ace921e3937a7235d53c98f8cb1424e81f02202a051d2e476f859116c824518f85cb33ee5c0dbb00bd65333119afcf65df38a8012102176ea39b268c6a02c87e1df0a3048c2d88f3c51f3a400405caebdc0c5fcc3828fffffffff6a8054af1584afa0fea6a77af6135733d500945049f9be5fec8139b14dabca1010000006b483045022004e0c1d10a060df530b3f8d50bb89b45ef1ce9beac38cd5f6a21f3569424ce43022100d85317d6442844e48e577186fae9beb84eea27370b26f0940219c2fd42ed4972012103e031d8551d70b6c9aba11166c7d859aaca964ef792449d81719e33957b666073ffffffff3672447f88f7723ed5940ccd3c6959ba838389bfa8b05d20a8135c3fad46947c000000006c493046022100a571bc94fe95abd9e437ad8cc0c9d21136fce19232b44db7c29f34d1e03ee9c6022100bd882402f1e728aa5d54e4d9d595c7fcd8a0dc7496b2e845d851b129b736317d01210339fcb39d2cf18977629ba99ce55c778a2b4b45b8a3f0c27b74f7c5699c8f82b3ffffffff010040be40250000001976a914563288c735c85427ae861228d2070984d1ae1afe88ac00000000", + "hash": "3e59073f9f611aa1ea5d41609b276ffe05896ee5ba4d18b2b0372ae7ebe9368e", + "fee": 12272774, + "depends": [], + "sigops": 1 + }, + { + "data": "010000000115195a2645dc7a0708285291ff5b989fcf0f9de938fc93e0757e201abc923feb000000006a473044022029669f76f1606b79496c6e63f44f3cbdf6b8ff43717dac58f55063246f8338e70220493376129db855707bb15d3c5db5addd88388af9893ada1f6dbb982e6292ae3c012102921795fac80d487c07c9c13246584a8cf89d31292ae72e848765c01bf2dbba67ffffffff02aa45d4ea2e5100001976a9148d55230e3bd5902a9df33064b9645ee8c371c67f88ac5c46899f040000001976a914787b69f746f1265be7c176e2d552c3cdc5564d0b88ac00000000", + "hash": "cb70de0a1b69907bf96a6d160ca826771f36991bdfdf78efb8e4ec99580f59f1", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000137d7ce81932d672528e410b3bbcca6baa7576ecc199f01c3a53a4db73d0d7973000000006c493046022100e631b92d983bcd24b1b396913521a26338bb727dede2a216e4ee38457915baf6022100d441796fc707bc42c94dade63a7e00e57c30822602b1b43b7fed814c8ef83013012103d50f4e09fbd6ed79216079222f15f6e365d8fd419a25079d0b816855a7987a41ffffffff02a534a121a15100001976a9143d2c365c3f8571339a29006f27e3e22c0870eff688ac8b6aa4fc2a0000001976a914fbd6d8991aff208e92f0930fa0a280ab1b6181f688ac00000000", + "hash": "e51dafaa414dd938a666cc07010c2b27259057f4ea4a968c960c4a4f9da1f01e", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001b828bce24849c9f65efd2b2b28ce6754e5a77c7a605f1df0738b617c8be468fb000000006c493046022100f3a1005500b5c8fb9118913a44d89ff6faa1168a180b97fb132eedb911eefa32022100bf4524867d961a5ff2b41aeaf56bcc149eb05458bacf5e462f27e8e5a66e7b110121026208ce3e027708bb9f781810290cc61b2dc133d089980721af336b48199b63d8ffffffff0208fbb40ca10f00001976a91499839b7821561c7201e56f4166835b1c27f0743d88acfa7e4024160000001976a9143ee87ba9cf6e7b002989617570cfb26b2d23741b88ac00000000", + "hash": "4413ec70d78ab11242c68e0527d49bb296b7e543b54bcb12409a6319da0fe083", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "01000000013c967dbaeb6e74de36285511b1f0f9fd023c4b321e863437df523ec28604bee1000000006b48304502207ac17862316c1fad5ef1c1110f956d681fd0b83e552f18f937b837a46c7cfaec0221009b67b6e04ad4f824f9aed97557b55ff39e857da79f8d9d31377c220babb4b2e5012103b147bd8996cd7be3fc48495a392e032196c36606e62318d874d004de7426b287ffffffff020920591ba14b00001976a9144629ee63603b448fa8787ce3dc0810b7690e9e3988ac30f99561ae0000001976a9145e429cc94206d2848da664a20c69ede6053f156988ac00000000", + "hash": "b53dbc9bc16a8e4a45828756784724be16fc5562b16c7551fb41d8f7cf711b50", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001075810dc92ab6a94bc5f6d458cf70fd2ebe12a5dcc3a9cb416ddb36bddd96a5a000000006c493046022100f06dc8be10a3102087ab487a530b3712688f9836cb083ed2dafd73b97524c8ed02210091ab248f08ad89a7a7ca80cada57c04bcf0175815c42e8bd89745b57b6e34e41012102d38f6cf71737dc97b44e545c5d5bb4567bf61b29a0bc9ee32d8115c4beb7e1ecffffffff02123f9097ee0700001976a9144d921bc9fa777b94a2faae67c1e57476b612fd3d88ac2d7d2bc3010300001976a91413b212059c167fe015ba4754f4334892a71e9ccb88ac00000000", + "hash": "5478c4c22b25d6e30b799ec3b1d46b957ef230f6bcc683db2cb90f15d8ba4372", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000ca668201f47da90e014d261ae0daeb47bc71e01aca19c276f0d5eced524ec17b7010000006b483045022078bbd5cf3482b56e9ff5513ff0ef3d4a0357448f7ae757a4a6ec41b6df0ea65b022100ad0a07e62a68a38bcfb9fb5725efecaf720c4133d3b6bd985b7b789bd05a96c4012102d3a4cfafea4a30f909c031d9fe35b0cf0c17b4a75abaa9775eeff22dd031719fffffffff7ecbf5aac87e235da03d472956dc19f9a3511dc443ac84a36b771c0ca5259cf7010000006a473044022005db419da0fac6449d576321fd23a01ee155e0793e152e3df426ca3649131ca1022040a2f04cc16f582eeebcbf6705eb4e3c9b6ff7c8901b2b28acbdf8fb59980dfb012102d3a4cfafea4a30f909c031d9fe35b0cf0c17b4a75abaa9775eeff22dd031719fffffffff4895064c7023e38e76f2b978dace4f319cde15525989b7c4190895eb9907d7bb010000006b483045022100c0becf9832f3e1ea19c7e543d7b0a3d091e59bcbbb82cf99c891ede5b6d6fe640220543def1852a66714a388f6d3f95f52c03f726de52324faa9b9a7173fb38a922e012102d3a4cfafea4a30f909c031d9fe35b0cf0c17b4a75abaa9775eeff22dd031719fffffffffe5dc129a28cf1dec043203bc492882e9c084e505028b8b3e3579bf58b5f5dc07010000006b48304502205fb8b85a14a0e52d681edf479fba2da990b664189bcb198910084b16bf48ba9a0221008ed09367f90910f2f2895f319d3a4d97d47fad36358e9a25653f1cc7071f33fb012102d3a4cfafea4a30f909c031d9fe35b0cf0c17b4a75abaa9775eeff22dd031719ffffffffff6a0d9472ab6cf72465add6c8ea30e59259861dd2fe920d8379e9bb75b2fb5e9010000006b4830450220131af5d8a0dbb4dd33439b31c81832a80221a05f3efd792d597f8bb0e1f85ea4022100b2846f4236f61a8eb98a8adc991943e7d46da0bd384348b2da583ec816fafe3a012102d3a4cfafea4a30f909c031d9fe35b0cf0c17b4a75abaa9775eeff22dd031719fffffffffc77001a58feb2763712217e8512fceb2f4afb6ff99dc09a2e69c3b27d85e8250010000006b48304502201cd7a2d8dad3fa4da7712c400ee5a0064cc68100cb048b55300db1b0151ba5ac022100abb6240d81fc016a818781fbaacb7c7261c0393cae6f01be2da5d5a64437b833012102d3a4cfafea4a30f909c031d9fe35b0cf0c17b4a75abaa9775eeff22dd031719fffffffff027f4adbafac59045ca8aefec96061d45b601dd7590cb42f748f1016508198ee010000006b483045022100f55b90042dbe114c148661ad1d46e3012f079725b051b099969b1c8fdff72720022062e6ea8a787fa4746d454a5d1f1ae18a4f10587f49afa6c6cf5cacd487220301012102d3a4cfafea4a30f909c031d9fe35b0cf0c17b4a75abaa9775eeff22dd031719fffffffffc8bcad73314e60427ccf9a0b2ce92cfd9667d2f6cc4958869c1093b81af43588010000006b483045022100cea126c37ca39b997f0802d8ee7df34ed2199f013ec4cda4ee5c30f9240ee97c02207d472304d2070cc826e91727dae1cbbf377bd8b65d96d8fe649fba52a5f653b9012102d3a4cfafea4a30f909c031d9fe35b0cf0c17b4a75abaa9775eeff22dd031719fffffffffa5c6f3760f0789650434310863d634335577c05059e6604ea755013eb089e4a9010000006b4830450220044d85916578bff77194e5f3d544d3d096c95ae11fcf3428a8ee53aceb24469c022100c7891abae517624ce6043fb003101f1db3fcc30475bbc5dcce8472081e072a4b012102d3a4cfafea4a30f909c031d9fe35b0cf0c17b4a75abaa9775eeff22dd031719fffffffff088631ad60dd379d8473fd2a0d5f57baab1d6cc038043521829c947454b9d322010000006b483045022100903424fedda85922ca85495b3e3357c64ede2c0530bb285adf496dcab102941f02200cc6861966e9283b0babb3214b859e53a36ec5cf77ce48a3300afbfc8e749de0012102d3a4cfafea4a30f909c031d9fe35b0cf0c17b4a75abaa9775eeff22dd031719fffffffff75b4928c5179555d9ac1ee38df36bf8ba635b6d52a34a67794d5c6169e3e4c60010000006a47304402202677be93766193cdb682de7bbadaef6c89086996cc636f5e5f6a9be089efacfb0220772546e44ef76adc0cfa64e398a5a2abd185763e1f497bcd655c758d9a5271e7012102d3a4cfafea4a30f909c031d9fe35b0cf0c17b4a75abaa9775eeff22dd031719fffffffff16a205955949cb9ef59da87933c8bf9591ed4867f883ceae7da66c27cc226295010000006b4830450221009819a79cb4e0ccd95f4829a0c86e08b7834a63d62fb0b85695043337d2241dde0220695973930bdc4e4758a79f7267d5be8eaa7c590cc79b7d3760ed3866fba3ef7e012102d3a4cfafea4a30f909c031d9fe35b0cf0c17b4a75abaa9775eeff22dd031719fffffffff01b8296c41a50200001976a9140052565d2d491bd1fb9c3fb72d27c3da460ec51388ac00000000", + "hash": "95a0fe11f01512504d5362df09f2c933c8d771fcec07f12c5cdbe9bab70b20c8", + "fee": 10000000, + "depends": [], + "sigops": 1 + }, + { + "data": "0100000001b22904b86c9ed788011172a43508ecbfa95ef3820e6124e3abda661328d90aad000000006a473044022027a86700763e5119e8733a2e39af05668fe563ec5db4288e2c1bfff3504bbb1002202f58da6a8c1314b23704f896353edf4afc0f33b953e1a7127318bb7441297028012103e37acde33c2b8135c60254b3331a49e02f215765c37fb5483905fa39f3d09308ffffffff02f017c246090600001976a9142e4d50642fa05b04ab95a07d8f3444260285373c88ac5acc9023020000001976a914eab19f7295f2fc8a1e591516b402c96ddc8d2d9d88ac00000000", + "hash": "bb02059752443e1bcd67ef29b7e42ee215c9bb23981549fa17c626150ce3dfa2", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "01000000051f1dd05dbc2e3a6d7820b359f3202407e044bf60fb45eed25c7fc8e9b0da41ed110000006b483045022100f742ff16e20f324c4ca4aaa8f5147dfbb8882fa0e63a56b2f0342ac054e7fc7a02203b1a65f9ba334162ab492edca8f4cedd24e41222ec111fb095cef3107ee20ff301210256819ba09a03ad132bd26d5ab5b400668bd076495527d6263af0e827f54820a1ffffffffc5183dfdbeb380d6caa04078a209069880a44c884a38e9d596eead7b8448c17a020000006b48304502202c573f63c58328b62b28c8ad07545f29407ca90b629fc2f74c495132acb93eeb022100eaebe43093bee24de96e7570d1b1116a38100271ac6ee3a0b66b48aadc242cb101210256819ba09a03ad132bd26d5ab5b400668bd076495527d6263af0e827f54820a1ffffffffca336bedd37cf0db7222c2c4bb03caa42dbd2711eac136a0a562cd37a56fc0b1000000006b4830450220794ef162e051fd6497673fbf72423065d47cb7d0341a7c8e384816f359ea578d022100d222ae7ad1ed4aae7ae502af9c27fb9ec213af3d55431200e6c10edeee06b77a01210256819ba09a03ad132bd26d5ab5b400668bd076495527d6263af0e827f54820a1ffffffff7ab8ece04c880c4df5270dec629b71e61c3f4026524713b481bfddf69dde2640100000006c493046022100e779489d86a1a607b165ee44699012eb01503d716c38e612e0fd4fa81fb8f14d022100c8241e22fb524d94d5a7dbad4522ddc302abe3f3c61e0a1f270e394e1c57ee5b01210256819ba09a03ad132bd26d5ab5b400668bd076495527d6263af0e827f54820a1ffffffff56e0cb5dfeb3d528b7b2c0f61e4bb2381a78a123706719a40f7c91eece72b1d21d0000006a47304402207a85cfd1451fd9d0149b9fa02211079169e5ba74ee1ca019e842a124367c63fe022042333727e43dbae3519d58c40892e179693236f7d1b18df6bc921ac409907e1201210256819ba09a03ad132bd26d5ab5b400668bd076495527d6263af0e827f54820a1ffffffff0200e1f505000000001976a91478eb2b9e95f230329d17b37b9cc15a960f88310488ac004af003210000001976a91432e7847d703795fef9a5e5ecacd4a077b9f69c8a88ac00000000", + "hash": "dedf88fdc1f331e18fb2b7ee17ece7078a2dc2f309d59a2acc46ed2084954617", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001cd428e3c59aca5104c355355e06b62a683f9fa2cc293efd626fe5bdf9b3ef329000000006c493046022100f8711239bfe6772505606768b3a0f5eb5643284e871c034a8ab63b3626e24818022100854d83fc462f0692bec901975e6b21120a42818f9be7617c19dcbc3b63e34077012102ebde94e0ad61f699edb7f16a516a5791e89248ed2eac7dd72f9ebcebab61b8e1ffffffff026d9e4c13fc2200001976a9140c31d94941d0e5332b2a30ba9d5ef96c359ad5c988ac6f438129f80000001976a91483899a087818a192eed71c9ef4b5ae0804ff0c9788ac00000000", + "hash": "d514ee289462c4d1b95a3d21256d9892c75835ae2032e2007e9931b333e0c623", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001a8ff4aea9861b688e5d4a19ea160a2e93e5cef8670aa8fe0804c997f6ee558c6000000006a47304402207b25652fd2f6d3dbce84f3ee79216e2580966c1bb8c3cc24e08328b877dd033d02204646150861802cb7608402b5dd11ef47b0df33b8d976925b001333361747f36e0121039a6c8349820147a619944a942bed00db5bf56bc49998638ba255b03620e4787effffffff0230980ada020000001976a914efb0a69531a5e2b11a862090fce83582f8e3a7da88ac00ca9a3b000000001976a9148ae116e6cf1cd69df356086982eaf290f2c2dc0588ac00000000", + "hash": "2ed9195d379af924673eb8b47be21c249cbe8ce442b011acf113c2217fc54ffb", + "fee": 0, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001b0cf0723f4636d7a479d1217161400d05bb1f2a6452e286ba720ce90360b5781000000006b483045022100fb0d5f1c827b2903dff8946728b228c3d737fa0c87830308cca7b9904ad0db8c02203aee2fd21d8db7df98e789c10b06460dbdbb0f003cc05cd6c232e7ff4ed1ab400121024ca716a050bb1b4ca2052ef09b41fb28db73cb88fc10bdeabeab64bf763fda92ffffffff0270f079b0a40700001976a914eb37e1f37d95dc00577e84158ff1cf0eac442dbd88acb8ced8b0010100001976a9140136eba060739fa3b79e2904718dbe26f6340d4f88ac00000000", + "hash": "0c2fb02c2c7ad696025aab5f60ca026724cb6449c80ca3c2cef23e2e82cafdb9", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "01000000016ff6ae8cb4304557b2c05a97b48ffb432bd84b60f55bd679f5647746cafea3ea000000006b483045022040bf72dbf4a71997d0671966ed1f5151c04ab616656dce06b76691f8aa99da72022100d49c0c1b0a8f09d01423e5be1e255c1b22ba2482d1c3b52eb4f8e75f4e53af0201210340b3452775776b6ecfdc2058feae9ec340c5805f579313d1f4fca9887416b403ffffffff02133db0196a0500001976a91482d757467c39eacb25d040f0cb1ab386a93f328d88acc53f6eea440000001976a914e673f0545d6d46dbe97d0a66133ecacde220972788ac00000000", + "hash": "7d4244efb25b375682bd8bcdddfd83981faca0837c9fe496e54678e1c53fc9c2", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "01000000013223f4ab618b32955a135990983c6ce3b63f84094b98d5dc33f274c2fcf7578a000000006a47304402207beff8181a43b3f9b63bcb44f25448fee21ab3f22b5b0cb23d617f936992dbe5022001c4bea13932fac2891aeced7d25d90d1f14ae1c2bfd5814c3020fd147c1cf4201210216732cd5c73e965bb4db4c99fd87777ad63a9a04c81009d561159bb2127a6ff9ffffffff02a88b3d1b170300001976a914fa7ec37f23b51c6899711693257d0c3917414c1888ac4a56ab8c090000001976a9144f454824821bc05d5cb894711a666bf9a8b394b588ac00000000", + "hash": "89ca0456a97ca65fa5a18144f288380153a392a6caafcfe2325e76d0d824e893", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "01000000015bae346131ff51e8bbaabb2705288f30193f1bfcf83acbb0dd2a7b68dfaa43e8000000006b48304502206790e5011da5c159208d176c3ca18e5ede71471ca4ac9f2b3eddc0e42b72a138022100c5a3143fa84bef3663b324a6ecc3b0ffeb65365f6a1ad4324e70cdf3b15e5c870121036e94a3381474928417538d7490db779f25ccd10afd4ec4654f845a17a1b32f74ffffffff02ab46aaaa280100001976a914c1fc748ffd63ae499e6eee3e1a7c0081cced540088ac5e3622f2550100001976a914075b413e74d55e75562e36e9d1e0b0552836059388ac00000000", + "hash": "b1b31afaf56e798aed207b97a6401f73bffe8eda709c9b7b6b1e74a702425204", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "01000000029b807099f5bb420bf307f383fb2ffc2e44f477448e51768c8b1261a21741784f000000006a4730440220191b891b4261d2fd6630a067050553ae64e810620314dc7afcb10191bb8a5761022009ead6c9122c2f5b474b624c436af8a39da5c9907b8d519b3388ed10c4811d41012103626c6c117c965422c9a069a31b0b24803bcf597fdd94bf375e450bbaf14e6528ffffffffce688d467cd2be9fd31964d4fde62ffbef48d1bdccf0d3b960781322f112efe2000000006b4830450220220926b88d7e081fe09fc39123932d633347cabf23294d5b1796c858f1fad2410221009bc9fe1cc8d7762d6c738a93b5991c1b85b89819df2ab5759554e268eed8fc3701210203e458bd45b91bf8190ffa96b2ad41c9c5566cf168a6d9ba3814adeb8f44178dffffffff02135dc93c5a0000001976a9146ec2c906ac520fbc5a3dc7cc154b0f602624247c88ac8f57f7fd0f0100001976a914b974e4b49893ec8682a37f30d295acd0cb32608988ac00000000", + "hash": "1e962f613d47f8e2f56668d65778a06d38185743eb6f0a77311df657a3cc9579", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001d59be9d3732ded705495fb49ecbc5a192ef3be3d3cb0d238c3dbd1b3420244c2000000006b4830450220358c86c3ad2356f1bdbe0a06afcf5fdc2296770e42d25e3b23f87f8227c053b9022100bf2b51f01a57a45d231ee8f523f9bf03a8e6abed8c4ce107d1eb57aa65aca094012102c8312a84dc98440e0371b5df0e2f6274643d3e0449af3f38d0f44e0788176362ffffffff0200de5d446f0100001976a9144b93e757a28577320d6e23e56e57a623f7c5e45588ac00c2eb0b000000001976a91439b214279c236a2ea618afb0f60aa7ce9931d74488ac00000000", + "hash": "a1b22cd22cf6ef91337d2ac9eadf348318c4816231f2cc2d022e654017a5ad1b", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001929d020a6900c5205a60dcabe7cc03186dd7316a29ec0d8eda68bada4ee2ea5c000000006a47304402205b3200d4752c9d3aa0e208a5a11dc76cef8510c5de5ca35c7c549f5af940679602207a7f6dc950884726e134470d8724bf93a647e4a5949212fba119192e1ff4851d01210271e416094019cc4d04859c70bfb9a4530a81cb6086567563c292ab9dba111ed4ffffffff02e2cd1b0aec0000001976a9149170100b3b5aaf0d318183dc2d1dc917dd11de0888ac00ab9041000000001976a9142252f5d13bd1cd2e2da35ddfa87c1f17fa4d3ef488ac00000000", + "hash": "8d901a0c19f0fe7a4ad72fdb8d3cb1d7d85f6c2f2102d9ecf99ea38f161066ef", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "01000000039183a21cf967183968fe47d3bf8114f898b44b1964d32a98bb05ef493c2b3811020000006b483045022100ed0b09b642b1593662b78a179b47b9891ab3a356f48897f7216bbc9203f37c8b022069aa2d0e7ebf101d4f944fd00cef5eae990395fad610da050c514f165d5225040121031c33056c5936cb32013f3e3642cd946346c004b9c04cad9472b1bed0f7e29db9ffffffffd7dc84cefe97858fa58c64de6fd2216c97560766fbaf0860fe444a0e587ef99c010000006a4730440220319e61cac5809c7a172b52e4d8c8a25d521f41ab18c45e2bab90ae111926c14d02205c8f3cfa414b46e0cae594693d49e83edef4a292fdefb44f1c2d1ba1381f9729012103682f73205f871192557fd476afb0cd0722873d2ea8d7ac70735a008c6e71ff6fffffffff9ea0a921f50cfcb1b0a4f1e63bdba5c49322c3e1fd405896404532c212bb5440010000006c493046022100eb249ce69b3665b3963b3dd1c687d161999d3cf230ac048face83fe4149a2ea70221009c87552e88107604ea608e5f434f246c6e2e073519293b66d1131138d237dd73012103deb74d499b20f856ef6577c3356ac310adc730cd21654fb432af168dc43f5460ffffffff0100e87648170000001976a91450b47f2397afc110c37ad4f0bc313f568089ef8588ac00000000", + "hash": "acf11b886326e3b84b636e6f634745535ae61b47091670747866e812971048aa", + "fee": 100000000, + "depends": [], + "sigops": 1 + }, + { + "data": "01000000046f7f665eb55d224c8f9f6042381110f5a1dd821a63c2e214c66e4a3da92e211a000000006b483045022100eff9f93b991ee739762abc21ff13153ddeb1efa0fae097c57c2047e504dbaf55022077801c07317edc075bf5004839459564745febb6163c48e8eb3602f8a74b3aed0121023a4541c65038665eb306e8f740af6602a56be14166c5ad6a8ea8850b1376346cffffffffa5e581e16ba931c29f4d4cd26abcdc9499bfbc7a4f03bcc77fb7833d632eae04970000006b4830450220632d7fd522b472849a86bd7e216e3d2526dd36a8aed928ab26c6f6f6d13088e5022100ced06459e533b176cfe1d42d40d42b899fe7e1060369666c15c298f1c4d6af50012103b3152fa094245bc8bcc64812aef02edd5ba7059fdda32c86c4a94989bf2fd21dffffffffc4a34e4e257b48a12cb5e31c26b5f3a07d14d9be2d6f0e06c4d8c252be5c70cd500000006b483045022073d8d8b6c3b3d21c4b27f09ae8f4995fe596a85a9e4f0577e4ff67dcf9f07477022100a097855e2aa68ee5a55a81c6b8972a6fd636b0a70ba8d127cd5887254dec99b2012103b3152fa094245bc8bcc64812aef02edd5ba7059fdda32c86c4a94989bf2fd21dffffffffe3794ea974e1d71d5c3bceee299ed06253cf17f91dd4e349eff963349e7befd0010000006b483045022100d43a6aa78088be61d7d28fab3bbf00008e332aab3288fa8981be9223ca94c37402205f997ecc5996d968891de55935c6649b4626f09fe92baf19deecedb3c3e2e4f5012103c914e550024b1c26cfd6757b7f889f859b6ecd2638ee24a5beddfa97ec3c2828ffffffff021ca47100000000001976a91493a9ab5be5ece21c9655fe4d378984ff6f4dab6a88ac0068c461080000001976a914796776f56e7f239b48d776c6c8be41cb46e3641488ac00000000", + "hash": "39288672675c8c063076db8e593ee1f6ccf2a2f262d8dadaadbfe5e58545d8ad", + "fee": 200000000, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001c6a16335abead115123cdcb0a48c4802978cc7f6c95a506e2c57f4957bc82d7e000000006a4730440220023438f4e6fa1c0754637ca532cd42f5c4735eab5d4e1057e4f37c203212ad080220223bd9cdec7005493e30d2063bcaf5611ab569d8950b64240d15891d1a8fed1a012103bd7f24e2ae9ee201fc2e3d722e5ce4ed2d81a5cbf6eecfaa5392f4f5513a8ce2ffffffff0200d29f8c830000001976a914863317e9f12b0496f4758529ceb3a31b1c949ca988ac0008af2f000000001976a914a54e8e45d93064809ede5e2be4d5fa3afebdad2588ac00000000", + "hash": "b974d3a31b236fc9cf09ca637c253f7965e6c3400f77d1b10b9209f3e9cc3b08", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001ce9aa21b4c2dd598cd535fc4045e05ef98131b66a971f93c418706a9ca31ee16010000006c49304602210081493422592db8b92162887749e4b9c37e6733b188d8616767855f983a66beea022100a1b937246795ced0d654892036b6d87e23d86b19eede88e9e432e061943b469a012103c21d6bba718f6bccc3fbf7072fd7232bca205eb365ea063d2ba4d23c3d4ebdfcffffffff02adda799c150000001976a9140f3603c4eaa674a986684a6520db7fd2ec3dc2bf88ac53a7c38c240000001976a91414e59ff321914ac7e157bea9978dde1327aa628b88ac00000000", + "hash": "eda956adb0d75d35cdf9370a7c9ee72669d5f782ed1cea1838c97cfb5ff4af02", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001a80ca4fa874e87158a3029127a56d69c81150c10c1459cdffbca1925e380b49c000000006a47304402203d14792cf1a7249fa010e0e2eaeb8b1f4ceb09838b25bfd476c7a64a11bf2fa2022016a674a449052019eb3fd813769aa92cb5e59451d2f2b161cde05a0ac898a305012103638cc823897d5b18e93bc5ea443258f1bc6226a10b49cb3a276429f65175f7edffffffff026b2063e01c0000001976a9142c0653a2f8e3fa9d903fc7a05486b7a3b21b78fc88ac1b0fe577050000001976a914ef08f58ef73dab166a68775695053b74e79a8b0688ac00000000", + "hash": "78ff95338105a0d7d94330393f9f5d11f818d596b4314d4597f2981684bb670a", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000169b0df2ea19ec4797ee32779eff683a2715097f782ff8b4ffe7791b75a89a577000000006b483045022100f672a0bc71654bec967b88366729253f2d6106f236b884bc6a23eab3f22c41b802206d5cd53a7053a7860693013fc12386a83f0cb465f80d68c78d9972be6435c69901210320ba6db681571c0f8edce920dc1c9f3d0009ba01b7677facfbe73d9a1ea259b3ffffffff0274d37147000000001976a914f02bb94fd9b2cc03eac7d8833d8f72a3b9c7fc1888acf32c7e61000000001976a914ce89bd2833750b2119375994b50203666bb9ffe088ac00000000", + "hash": "b0e48dd91f017bcad898cafd26f509fcb574a127b68302fd10eea115ae0d8c48", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001241ea8df8ff7999312582eb42aba3a38661dc35d51ad02ea2410708d7682e520000000006b48304502201d1ff590486c55eb41286b64f7f895830c4fea99c4aa2c1e5a3303da8897b34c02210094aa46eb7d2dbc49abaf9b543d441aa5be6684435f4f230ffaabc2cced012a4a0121034d2c889823f9a154b42b4852eee4853221b7baa8538232e761d4f99d8d41fdcbffffffff023f9cfe5a010000001976a91471c74851081ce1789252699b2770ac66498ccbc688ac0cf0891f030000001976a914dd31ce6c169d08e7cd4e270dae7c00cfd83b5a1088ac00000000", + "hash": "2ac0aa309982a31da86bbb7d4b994264c859a9fc6c00f924b2dcc711a969bd48", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000137cd30fb7157a7c3afffc159631192ef5c7752aa2ddcce89f48650d182188083000000006a473044022043ebcdd9c26d89822e85348ff12832b0a3db1dbbcf952280716aadc29993db7102203a84733269f889b80c202371b9f8f9db745147ff709a7dda5c7947715263c81a0121034bbcf0ef506a690a9285bd1f95949f4955d501f13af14fe126ad3450e6f281a5ffffffff026bf37a75000000001976a914d7eab3e5fe0d177fafbf196d4e55a48424905d8a88acd0ea6015020000001976a9149146130fc251988b9d8195a4e2d31ff5eeab8fc388ac00000000", + "hash": "e4b5d6f5e3f6a7300717007d1a13db84d5eca1854ea9d5bca475ad86e8dc8020", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001342ff5fa049cd0a04bc521d5da466610933e2164758f5b3338391746a3dfbba4000000006b48304502207bfb7ba8957b89ec8b1c10ec4402f39af7c87a8ab81b738cac76ef2dbf2a68d1022100e6eeb41a6efbc7c04c9cda67b606cd51e4f8ef9b3baf3ff947c7a0c3b3be8bd4012102be0d37572afd7523d73593f59973410b0ef775e07c0c0694e5a7b352f5507894ffffffff0257ab9319000000001976a914dbadfe2d05d2650532d2623b4e59fcd679b447ec88ac0008af2f000000001976a914dc3837eb6710cdefdf8ef7d4018739156e3d740588ac00000000", + "hash": "72e105a8a7b1e4a461cf5561dacdaa326d15c476b8054921e486a608d53a64e2", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "010000000189ea963f66249e010d357097431afed2fcd7e9345b3090a7d51ce672c37f07e2000000006c493046022100e83ac510cc7587a7c018bd1f4092285cec81b45063e41ce1c9f8149c38dc07b2022100b10cf0f4ac115e5222d2fff237f5f3076cb4585b50812bc704bf8c342d55803c012102ec1f277decf68eb6328057a7b21656170ef87a27626397e261a1a2d06f084529ffffffff0280474ca1040000001976a914d90832fbdd0e9d932d5dbcd9b31a26120b9c133188ac0084d717000000001976a914669f108bc948b0bc57a47d7f4250cb0ceadf891788ac00000000", + "hash": "47fde285ce4e25b14617ca18d42f76c630e43f69821049ad2b1446f44999c6c2", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001fd8c76c4021ab2d7b2fa01520b07421d4384a0796927e538f9774cce5b46c497000000006b48304502204524c2ec1134ae9a3b6d32ac5e11d8dc185dc65a9565916f1f29d22be4d954b2022100c14d3bad75d728e28a11d68a35c348f02333c3857451dece0c6276227bb30434012103e92dde7ba3f997a8a2453553edf195d8d5372dc5791515336c82c7897c4081c2ffffffff02011e6b12000000001976a914191ede63bd70e0588f0028c8a830be4b69e04b0788acb2a93e30000000001976a914f7f0c0bc2506f51f98d88a92a30b7796b01fc55588ac00000000", + "hash": "0d6162db518c14d73d9f8110577d885ab69684a93dcb01ba27df92bce6c14bf9", + "fee": 100000000, + "depends": [], + "sigops": 2 + }, + { + "data": "0100000001ef6610168fa39ef9ecd902212f6c5fd8d7b13c8ddb2fd74a7afef0190c1a908d000000006b483045022100ae1d450f1672505b2e4a4d0dec54add5e05abc9e2985122db7f491b600d2be2902203fdd58cf306f0264d7446d89abd3c48210738df4f9ed93a2bbedab01a952386101210211ea38e37a779fb754afc7a6a364ff30c73aa35fecbf6582c1a03e6a4a653895ffffffff02e24195c2eb0000001976a9149780fe5b3e4e8caebaa8dfed4c7f4b781a6cddec88ac00ab9041000000001976a9149ff5f82a861fb2d7f119e4e9e1a866fed721931e88ac00000000", + "hash": "5604d0ee44c2b6d56d7a344a452b51081133e8f41476d7580e6ab768f85262c5", + "fee": 100000000, + "depends": [ + 80 + ], + "sigops": 2 + }, + { + "data": "0100000001c56252f868b76a0e58d77614f4e8331108512b454a347a6dd5b6c244eed00456000000006c493046022100fdb0f39a3c9f25e8035c3cc1d4a852adc4c0ff788f140f7fd1b68e44747d1f17022100f26e2d86350bb12e4ceec7583cda2853b0c7e986d87a3867ed3aef738570c8920121036de007d3b54f9b811e62efbfd10b3e6f9c35407f8e4012e63a2e05ac34f35a9cffffffff02e2cc6945eb0000001976a914360a2c6a53e0754bf7dc316ea0ae419f09e01bb588ac00943577000000001976a9143fd66f4c66c44808352fa8addd1fc746b10db3c688ac00000000", + "hash": "dc29d59fd853c89ef28c5cb00b558da681d7a9622095edd72d062cfa1c793a50", + "fee": 100000000, + "depends": [ + 92 + ], + "sigops": 2 + }, + { + "data": "0100000001503a791cfa2c062dd7ed952062a9d781a68d550bb05c8cf29ec853d89fd529dc000000006a4730440220079351f0e4c88a7522b5fe4e04d24848c2c6cc07fe1ae914e84c2c91f37a24e402206a0d475c38ffb639f02347bd07784b93ebe5f336aadb80bb76a0f27c4b68e9b80121032b5a154d56e7fe6470032d27fbdef11fae1b0c6bbe891806a990c9d5b5940a1dffffffff02e240e3fdea0000001976a91446824e9fb225dd4f0f8e39050ca337171c52abb588ac00ab9041000000001976a914a63df6c5df0731aa91855e25638ad50e4b1e571b88ac00000000", + "hash": "9831d1e7afd4b4a61dfa93ec826249a1eab134cf4be8d583ba9dd24a575ff7c7", + "fee": 100000000, + "depends": [ + 93 + ], + "sigops": 2 + }, + { + "data": "0100000001c7f75f574ad29dba83d5e84bcf34b1eaa1496282ec93fa1da6b4d4afe7d13198000000006c493046022100ca561db6b6eb388483bcff91d60a047e440f34f143bc845e9adde1bcbe314146022100c5500ae949cbb8ddfa6f6d719effee86f32f4fe9c87e3f42dad7e2920bd1490a0121036c28a9aafcb0f7bca792566d3829e5627ca97ed3f6e539d00a1c71fa5cc1a9d7ffffffff02e230859eea0000001976a9146fb6f0446479ba238ed8ad7ec8a5d6ae85450cac88ac002f6859000000001976a914fb86abfd955d60f55681b39fcb9e8737f242470e88ac00000000", + "hash": "1605a0dd0a741ef613b6302a5f65705673f3de5580bac89fa8cc5f692f5e412c", + "fee": 100000000, + "depends": [ + 94 + ], + "sigops": 2 + }, + { + "data": "01000000012c415e2f695fcca89fc8ba8055def3735670655f2a30b613f61e740adda00516000000006a473044022040e3392fe571c5ccd1c41467d25f36fd0751d4d289f128a0e1bcffca0677b87f0220499a8b5151f5b4d30ac2958b75fb668c1f3210b4a90b09cdee3d09ad3efe7f74012102578ee38461c804c869fb0f260ffb5f44966173b1105a794b1fc3d1391dda87beffffffff02e2c30851ea0000001976a91413e54a350a69b8ce8cc4d5c593fef01bbee7de9d88ac008c8647000000001976a91491e277cb7a91fe69212ca3f9f7dc3b1d227d9a0888ac00000000", + "hash": "83af3554c94b4cca40dadc0b48b2129f8411a26718516378d43b721866847085", + "fee": 100000000, + "depends": [ + 95 + ], + "sigops": 2 + }, + { + "data": "01000000018570846618723bd47863511867a211849f12b2480bdcda40ca4c4bc95435af83000000006c493046022100bbb7e90dd7f7ca9f097a7d59be5e974a185f8cfe990186f798140747fe340e1d022100ef93b0b2b6e6f0d7e14a0056ca5f8f3f99b9289e0f4a5486322b545ebb5d169e012103528a9446919965b775646d8d13f7b14a745f0223ddac986082c24cf6d0619b00ffffffff02e2378209ea0000001976a9141dfb93f672e3678b3c025463539bff349384f1f688ac00ab9041000000001976a91476ef51f8108180ea8de4fe070d828b2eea8be9c888ac00000000", + "hash": "a238de90424d73a7448e9f9ff612618697ae1374817981cb8e7b688d9f5fa1c3", + "fee": 100000000, + "depends": [ + 96 + ], + "sigops": 2 + }, + { + "data": "0100000001c3a15f9f8d687b8ecb8179817413ae97866112f69f9f8e44a7734d4290de38a2000000006b483045022100ba6854e9386ef19228b3496e9330873e8083479adf73be6b8c8b9ce88c1fcccf02206f9f85e6560ddf6c9ab681fa2a7f31853716d65cb0ccfd6319774acd2b196eb90121023f735c212e585ad173dbed8a7c134309fc129791bf9a6381e070d9f5cecdd410ffffffff02e2462ea4e90000001976a9145b5cfb868fe35efe4cace759ca755fc9c99a3a6b88ac00105e5f000000001976a9144b1aa371d3a2a2e79918878c2c5480979a2eb8aa88ac00000000", + "hash": "a84cb1e120638ef563f0be527c7b8b290a612339cf12013941cb305792225272", + "fee": 100000000, + "depends": [ + 97 + ], + "sigops": 2 + }, + { + "data": "0100000001725222925730cb41390112cf3923610a298b7b7c52bef063f58e6320e1b14ca8000000006b48304502207d73769eaf1c1344dbde9326d048f4261f650ad9a5ab9f9d889ef94410bd9af30221008be2a7c44fae76d1ccb52539153941d714bb045c7bb3ccac4728b170ce43992e0121021bd8c2ee248582aebcda0dd8c0300ac4563773629776a73117622ed1ddb65816ffffffff02e236d044e90000001976a914b2fcbc0fdab65d95ec25538b43dbc6919ce59e0188ac002f6859000000001976a9147f33a629e17ac855b3869608d35522cb13dd786988ac00000000", + "hash": "b9d16bc9e6e84c0a22559f8c2a475582279348ae1fd731e4ffab1dfa6f238bca", + "fee": 100000000, + "depends": [ + 98 + ], + "sigops": 2 + }, + { + "data": "0100000001ca8b236ffa1dabffe431d71fae4893278255472a8c9f55220a4ce8e6c96bd1b9000000006b483045022100e37e846ba41c9c97fec6c00452120d3c2d03b608e09b165fb289aa53e130dbf40220075c702b3f59afdf0a3f721455aacdd525f05fb83a186d5cbc625977d692ba740121036f581fe9652d53b34412ded706a94bb7d60fa5df4dcb5b391740fc76de9ae6fcffffffff02e22672e5e80000001976a914a64133d68bc875fa03a3b0578af69ce39ddb1ec688ac002f6859000000001976a9147b3ecf5fc734b1ac5619ac45beb4f095b2a591ed88ac00000000", + "hash": "a6514c9120e3c78983c24acbc8cb0968706a717d8f9d113767e3df8b8698a6a1", + "fee": 100000000, + "depends": [ + 99 + ], + "sigops": 2 + }, + { + "data": "0100000001a1a698868bdfe36737119d8f7d716a706809cbc8cb4ac28389c7e320914c51a6000000006c493046022100a6cbdb0f16dee3f6ce1ca6e5e39cfe245d4e7bebc6c2398d240c91523557bf0102210083241fc3f5d757c36e7f788e6da8c0ef0f39c6a9837a2e31050b2dccc9faad4a01210312c9ceaad47710f52a9e828aa0100a3cef94044938c72cee4d4e73ebc67892dfffffffff02e2161486e80000001976a9149c58426fdc77ebb8d620241fd9fb3b564e51b66e88ac002f6859000000001976a9140d8d3fbbc12ece7c1658d29ee77440ba56d5163b88ac00000000", + "hash": "6ac775b14eedc08dc6d6b673b97cb379f1ae329a58d0999ac377a6019749050b", + "fee": 100000000, + "depends": [ + 100 + ], + "sigops": 2 + }, + { + "data": "01000000010b05499701a677c39a99d0589a32aef179b37cb973b6d6c68dc0ed4eb175c76a000000006b483045022036e9ae6efd62b47aa073fdc89138dbebc44f5982dcf73a51b9cf4181a388691502210093b7fb97d1f7528a3a619072cb1dcd1c0c9b1f23528c6f7f346d3bca3a3d44b1012102a0eb91e96e0bc795dee56af7e896ad2804b66f9e22aae73d117b02566b67705fffffffff02e206b626e80000001976a9141cdd9b4dd0e47a1ef1b05aa84344e54846ad7a6288ac002f6859000000001976a914279db41237358d331029bef229aa5f0ae6845a4888ac00000000", + "hash": "7c36986abda8adacc8db7fddbf54e8017096d3a709a22bc29e619869c8e0321f", + "fee": 100000000, + "depends": [ + 101 + ], + "sigops": 2 + }, + { + "data": "01000000011f32e0c86998619ec22ba209a7d3967001e854bfdd7fdbc8acada8bd6a98367c000000006b483045022100da688982a8aad076a1189be55af3a264586d369f112761339f38831ea9379ed1022011d241a51db10214ab7c61df60b1f802553f77c3c36bb4c0750b9e3a4c1e9dbc01210359d8512eaa8de061a6dd7eda1d0b3edcedef760aac0a7735e6554108956d26b7ffffffff02e29939d9e70000001976a914d2672f56d8bf591903d7c0b08fef902b333f4b1c88ac008c8647000000001976a914a2e9e0138db80a45b086f783bf0153a5a754d59688ac00000000", + "hash": "2fc1cc3dbd0a1678453513ce2ded6c285a1ea49308a0cfb03569546cab0c3bdc", + "fee": 100000000, + "depends": [ + 102 + ], + "sigops": 2 + }, + { + "data": "0100000001dc3b0cab6c546935b0cfa00893a41e5a286ced2dce13354578160abd3dccc12f000000006a47304402207412628a9c305e75774f321e73df8c6e3d20c5d13f66215decb8e04f141b346502200f4de9b464666f982060d4a04db28c8677c6aad4618172087abe7444a9a7eeff012103306c7ad57ee3045d1efe48bc395a00b693da48cbf53eb6bf2b3e0dba1d5614baffffffff02e2a8e573e70000001976a9141479c62fcebcbbdca903ed0a3553d285e0faf12e88ac00105e5f000000001976a914abfb9bef4741efb869689a140758c5a077a2f71588ac00000000", + "hash": "de16b7717ce4db278b3fcda36bce6fcc7029faa24f99fa9c088bf9a088879084", + "fee": 100000000, + "depends": [ + 103 + ], + "sigops": 2 + }, + { + "data": "010000000184908788a0f98b089cfa994fa2fa2970cc6fce6ba3cd3f8b27dbe47c71b716de000000006b483045022055779f16df0c9aee4166dbcebf40812987fafdb624db1796efa49f7cccc99325022100cf6cc7bc74c4472d7a3b691e15bdd570efa3223783c9a3d44b04028615f700c901210218d86621ac525e02df3db00910a69f99a964bab068702070756c51b3770b4210ffffffff02e2988714e70000001976a914397b241e829e74bed7be838f60b094477bbb89a588ac002f6859000000001976a9145caaeabc8268e40e2c541a43fcc097aa44f2710c88ac00000000", + "hash": "02d7e7f02387c8d27434d1ac6a049909c66486adbe3da5908f024a035c93dcdf", + "fee": 100000000, + "depends": [ + 104 + ], + "sigops": 2 + }, + { + "data": "0100000001dfdc935c034a028f90a53dbead8664c60999046aacd13474d2c88723f0e7d702000000006b4830450221009169ba805aca0fbc504599cf5ba4921a9ee8ce7aad2a8188fec638a880d375e80220121bcabb0bcb94c7e8e062ec7f5d7636936af3236d2bf0fd6b51313d44ed10a6012102882c35a37d5c6aebe7b0cf5727a431c31d1d1873c3b156fa4b83bcc05b62f0d3ffffffff02e28829b5e60000001976a914f1343c794d65a08ca72188facd89cbbe4053e71688ac002f6859000000001976a914fa139561b6e27b4d77b266d271fd7e5399ad37c588ac00000000", + "hash": "72d77617e6b900e828058e3bf3c6264c4497f39fcc5a2005c4e4af0c316bd69a", + "fee": 100000000, + "depends": [ + 105 + ], + "sigops": 2 + }, + { + "data": "01000000019ad66b310cafe4c405205acc9ff397444c26c6f33b8e0528e800b9e61776d772000000006b483045022100b7606c6968f41686a4d98f631436a63d82453b8809666447a1fce75bb4b26f5202202695608a38bb34483912c71c0b0ee9999a07bbe7f458e546573ddd743b74e86a012102186ad1ea3e46a8bf521bb3e1837e86ced6b732fbf3c2c260db62422bc9f7003cffffffff02e297d54fe60000001976a9146af9a30669557eda33ad6f812d662983f07ead5c88ac00105e5f000000001976a914516f64adafb7fb2abe71c6457aaab1461b623fed88ac00000000", + "hash": "5bf5b883bfd7758b437d440133735ac3cc5297e9882241686612f8ec0be243e3", + "fee": 100000000, + "depends": [ + 106 + ], + "sigops": 2 + }, + { + "data": "0100000001e343e20becf8126668412288e99752ccc35a733301447d438b75d7bf83b8f55b000000006b4830450220485986e5e8f8de432fb56288a7c4e30e7d49a8e6ecc117c324508fff3eebba37022100edc02d76d28b3f72e46ab6b6aa14630706cbe0a6d188708e1d00a6a27dde12640121020cb085e56360e0c986709964568196d6b804a3b08577d5f81b77d90f36a29372ffffffff02e2a681eae50000001976a9142c6ddf58c3341fa0a1c84eccf47c8889e9ce5c7488ac00105e5f000000001976a91453cd4581d949e8fd2d337d33b69523f8b2ca147788ac00000000", + "hash": "c660897e0fe3b89567f4ba449afb3882d4b4bc8a848629f1f2400463588c8f71", + "fee": 100000000, + "depends": [ + 107 + ], + "sigops": 2 + }, + { + "data": "0100000001718f8c58630440f2f12986848abcb4d48238fb9a44baf46795b8e30f7e8960c6000000006b48304502206e94956a16f21b8cf72fd31d4d0ae273232277d4851a59f061594c7afed3ac81022100a2ddbf096d85f528bd8306ba398e302504ce790ff1d4813ca7a0e45f31fe8a3e012103a3ac87ea12dfb77cb1484fff61b778ba271f5b533e7ba5306d90f56bb72f93b2ffffffff02e2b52d85e50000001976a914109025ec528846ea542ea018e375126be6f6cf2c88ac00105e5f000000001976a914798e9b9e42bf4efca480f71a155460ce771f8b7888ac00000000", + "hash": "7cc57873fe6eaeae864ca8caf857d8b5c214e7cd2e38a2b3820b0bbb92780e46", + "fee": 100000000, + "depends": [ + 108 + ], + "sigops": 2 + } + ], + "coinbaseaux": { + "flags": "062f503253482f" + }, + "coinbasevalue": 5009566195353, + "target": "00000000000404CB000000000000000000000000000000000000000000000000", + "mintime": 1388867404, + "mutable": [ + "time", + "transactions", + "prevblock" + ], + "noncerange": "00000000ffffffff", + "sigoplimit": 20000, + "sizelimit": 1000000, + "curtime": 1388868033, + "bits": "1b0404cb", + "height": 42042 +} \ No newline at end of file diff --git a/jobManager.js b/jobManager.js new file mode 100644 index 0000000..d1c2b7e --- /dev/null +++ b/jobManager.js @@ -0,0 +1,78 @@ +var events = require('events'); + +var binpack = require('/usr/lib/node_modules/binpack'); +var bignum = require('/usr/lib/node_modules/bignum'); + +var merkleTree = require('./merkleTree.js'); +var coinbase = require('./coinbase.js'); +var util = require('./util.js'); +var blockTemplate = require('./blockTemplate.js'); + +/* + +For each crypto currency have a templating instance which holds an array of jobs. +jobs all hold slightly modified block templates that all have the same prev hash. +any jobs with outdated prevhash should be purged. + + + */ + + +//Unique extranonce per subscriber +var ExtraNonceCounter = function(){ + var instanceId = 31; + var counter = instanceId << 27; + var size = 4; + + this.next = function(){ + var extraNonce = binpack.packUInt32(counter++, 'big'); + return extraNonce.toString('hex'); + }; + this.size = function(){ + return size; + }; +}; + +//Unique job per new block template +var JobCounter = function(){ + var counter = 0; + + this.next = function(){ + counter++; + if (counter % 0xffff == 0) + counter = 1; + return counter.toString(16); + }; +}; + + +var JobManager = module.exports = function JobManager(options){ + + //private members + + var _this = this; + var jobCounter = new JobCounter(); + var jobs = {}; + + function CheckNewIfNewBlock(blockTemplate){ + var newBlock = true; + for(var job in jobs){ + if (jobs[job].rpcData.previousblockhash == blockTemplate.rpcData.previousblockhash) + newBlock = false; + } + if (newBlock) + _this.emit('newBlock', blockTemplate); + } + + + //public members + + this.extraNonceCounter = new ExtraNonceCounter(); + this.currentJob; + this.newTemplate = function(rpcData){ + this.currentJob = new blockTemplate(jobCounter.next(), rpcData, options.address); + jobs[this.currentJob.jobId] = this.currentJob; + CheckNewIfNewBlock(this.currentJob); + }; +}; +JobManager.prototype.__proto__ = events.EventEmitter.prototype; \ No newline at end of file diff --git a/merkleTree.js b/merkleTree.js new file mode 100644 index 0000000..51cd2bc --- /dev/null +++ b/merkleTree.js @@ -0,0 +1,82 @@ +var util = require('./util.js'); + + +/*var merkleJoin = function(h1, h2){ + var buff1 = new Buffer(h1, 'hex'); + var buff2 = new Buffer(h2, 'hex'); + var buffJoined = Buffer.concat([buff2, buff1]); + + var buffJSON = buffJoined.toJSON(); + buffJSON.reverse(); + var buffReversed = new Buffer(buffJSON); + + var hash2 = util.doublesha(buffReversed); + + var dhashJSON = hash2.toJSON(); + dhashJSON.reverse(); + var dhash = new Buffer(dhashJSON); + + return dhash.toString('hex'); +};*/ + + + +var MerkleTree = module.exports = function MerkleTree(data){ + + function merkleJoin(h1, h2){ + var joined = Buffer.concat([h1, h2]); + var dhashed = util.doublesha(joined); + return dhashed; + } + + function calculateSteps(data){ + var L = data; + var steps = []; + var PreL = [null]; + var StartL = 2; + var Ll = L.length; + + if (Ll > 1){ + while (true){ + + if (Ll == 1) + break; + + steps.push(L[1]); + + if (Ll % 2) + L.push(L[L.length - 1]); + + var Ld = []; + var r = util.range(StartL, Ll, 2); + r.forEach(function(i){ + Ld.push(merkleJoin(L[i], L[i + 1])); + }); + L = PreL.concat(Ld); + Ll = L.length; + } + } + return steps; + } + + this.data = data; + this.steps = calculateSteps(data); + +} +MerkleTree.prototype = { + + hashSteps: function(){ + if (!this.stepsHash) + this.stepsHash = util.doublesha(Buffer.concat(this.steps)); + return this.stepsHash; + }, + withFirst: function(f){ + this.steps.forEach(function(s){ + f = util.doublesha(Buffer.concat([f, s])); + }); + return f; + }, + merkleRoot: function(){ + return this.withFirst(this.data[0]); + } +}; \ No newline at end of file diff --git a/node_modules/base58-native/.npmignore b/node_modules/base58-native/.npmignore new file mode 100644 index 0000000..e3fbd98 --- /dev/null +++ b/node_modules/base58-native/.npmignore @@ -0,0 +1,2 @@ +build +node_modules diff --git a/node_modules/base58-native/LICENSE b/node_modules/base58-native/LICENSE new file mode 100644 index 0000000..40ffcfa --- /dev/null +++ b/node_modules/base58-native/LICENSE @@ -0,0 +1,27 @@ +Copyright 2013 BitPay, Inc. + +Copyright (c) 2011 Stefan Thomas + +Native extensions are +Copyright (c) 2011 Andrew Schaaf + +Parts of this software are based on BitcoinJ +Copyright (c) 2011 Google Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/base58-native/README.md b/node_modules/base58-native/README.md new file mode 100644 index 0000000..0d7bae5 --- /dev/null +++ b/node_modules/base58-native/README.md @@ -0,0 +1,29 @@ +base58 +====== + +An implementation of Base58 and Base58Check encodings for nodejs. Note, the +implementation of Base58Check differs slightly from that described on Wikipedia +in that it does not prepend a version byte onto the data being encoded. This +implementation uses the bignum library (which is a native module and uses the +openssl bignumber library functions). + +NOTE: earlier versions of this package used native C code instead of bignum, but +it was found to be unstable in a production environment (likely due to bugs in the +C code). This version uses bignum and appears to be very stable, but slower. The +C version of this package is still available on the "native-module" branch. A few +additional methods added to bignum would probably bring the speed of this version +on part with with C version. + +Installation +============ + + npm install base58-native + +Usage +===== + + var base58 = require('base58-native'); + base58.encode(base58.decode('mqqa8xSMVDyf9QxihGnPtap6Mh6qemUkcu')); + + var base58Check = require('base58-native').base58Check; + base58Check.encode(base58Check.decode('mqqa8xSMVDyf9QxihGnPtap6Mh6qemUkcu')); diff --git a/node_modules/base58-native/base58.js b/node_modules/base58-native/base58.js new file mode 100644 index 0000000..d1ac810 --- /dev/null +++ b/node_modules/base58-native/base58.js @@ -0,0 +1,116 @@ +var crypto = require('crypto'); +var bignum = require('bignum'); + +var globalBuffer = new Buffer(1024); +var zerobuf = new Buffer(0); +var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; +var ALPHABET_ZERO = ALPHABET[0]; +var ALPHABET_BUF = new Buffer(ALPHABET, 'ascii'); +var ALPHABET_INV = {}; +for(var i=0; i < ALPHABET.length; i++) { + ALPHABET_INV[ALPHABET[i]] = i; +}; + +// Vanilla Base58 Encoding +var base58 = { + encode: function(buf) { + var str; + var x = bignum.fromBuffer(buf); + var r; + + if(buf.length < 512) { + str = globalBuffer; + } else { + str = new Buffer(buf.length << 1); + } + var i = str.length - 1; + while(x.gt(0)) { + r = x.mod(58); + x = x.div(58); + str[i] = ALPHABET_BUF[r.toNumber()]; + i--; + } + + // deal with leading zeros + var j=0; + while(buf[j] == 0) { + str[i] = ALPHABET_BUF[0]; + j++; i--; + } + + return str.slice(i+1,str.length).toString('ascii'); + }, + + decode: function(str) { + if(str.length == 0) return zerobuf; + var answer = bignum(0); + for(var i=0; i 0) { + var zb = new Buffer(i); + zb.fill(0); + if(i == str.length) return zb; + answer = answer.toBuffer(); + return Buffer.concat([zb, answer], i+answer.length); + } else { + return answer.toBuffer(); + } + }, +}; + +// Base58Check Encoding +function sha256(data) { + return new Buffer(crypto.createHash('sha256').update(data).digest('binary'), 'binary'); +}; + +function doubleSHA256(data) { + return sha256(sha256(data)); +}; + +var base58Check = { + encode: function(buf) { + var checkedBuf = new Buffer(buf.length + 4); + var hash = doubleSHA256(buf); + buf.copy(checkedBuf); + hash.copy(checkedBuf, buf.length); + return base58.encode(checkedBuf); + }, + + decode: function(s) { + var buf = base58.decode(s); + if (buf.length < 4) { + throw new Error("invalid input: too short"); + } + + var data = buf.slice(0, -4); + var csum = buf.slice(-4); + + var hash = doubleSHA256(data); + var hash4 = hash.slice(0, 4); + + if (csum.toString() != hash4.toString()) { + throw new Error("checksum mismatch"); + } + + return data; + }, +}; + +// if you frequently do base58 encodings with data larger +// than 512 bytes, you can use this method to expand the +// size of the reusable buffer +exports.setBuffer = function(buf) { + globalBuffer = buf; +}; + +exports.base58 = base58; +exports.base58Check = base58Check; +exports.encode = base58.encode; +exports.decode = base58.decode; diff --git a/node_modules/base58-native/package.json b/node_modules/base58-native/package.json new file mode 100644 index 0000000..d28128a --- /dev/null +++ b/node_modules/base58-native/package.json @@ -0,0 +1,56 @@ +{ + "name": "base58-native", + "description": "An Implementation of Base58 and Base58Check encoding using bignum library.", + "version": "0.1.3", + "author": { + "name": "Satoshi Nakamoto", + "email": "satoshin@gmx.com" + }, + "contributors": [ + { + "name": "Stefan Thomas", + "email": "moon@justmoon.net" + }, + { + "name": "Andrew Schaaf", + "email": "andrew@andrewschaaf.com" + }, + { + "name": "Jeff Garzik", + "email": "jgarzik@bitpay.com" + }, + { + "name": "Stephen Pair", + "email": "stephen@bitpay.com" + } + ], + "main": "./base58", + "keywords": [ + "base58", + "base58check", + "base64", + "encoding" + ], + "repository": { + "type": "git", + "url": "http://github.com/gasteve/node-base58.git" + }, + "scripts": { + "test": "mocha" + }, + "dependencies": { + "bignum": ">=0.6.1" + }, + "devDependencies": { + "mocha": ">1.0.0" + }, + "license": "MIT", + "readme": "base58\n======\n\nAn implementation of Base58 and Base58Check encodings for nodejs. Note, the\nimplementation of Base58Check differs slightly from that described on Wikipedia\nin that it does not prepend a version byte onto the data being encoded. This\nimplementation uses the bignum library (which is a native module and uses the\nopenssl bignumber library functions).\n\nNOTE: earlier versions of this package used native C code instead of bignum, but\nit was found to be unstable in a production environment (likely due to bugs in the\nC code). This version uses bignum and appears to be very stable, but slower. The\nC version of this package is still available on the \"native-module\" branch. A few\nadditional methods added to bignum would probably bring the speed of this version \non part with with C version. \n\nInstallation\n============\n\n npm install base58-native\n\nUsage\n=====\n\n var base58 = require('base58-native');\n base58.encode(base58.decode('mqqa8xSMVDyf9QxihGnPtap6Mh6qemUkcu'));\n\n var base58Check = require('base58-native').base58Check;\n base58Check.encode(base58Check.decode('mqqa8xSMVDyf9QxihGnPtap6Mh6qemUkcu'));\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/gasteve/node-base58/issues" + }, + "homepage": "https://github.com/gasteve/node-base58", + "_id": "base58-native@0.1.3", + "_from": "base58-native@" +} diff --git a/node_modules/base58-native/test/basic.js b/node_modules/base58-native/test/basic.js new file mode 100644 index 0000000..bd0a7a7 --- /dev/null +++ b/node_modules/base58-native/test/basic.js @@ -0,0 +1,49 @@ +var assert = require('assert'); +var base58 = require('..').base58; +var base58Check = require('..').base58Check; + +var testData = [ + ["61", "2g", "C2dGTwc"], + ["626262", "a3gV", "4jF5uERJAK"], + ["636363", "aPEr", "4mT4krqUYJ"], + ["73696d706c792061206c6f6e6720737472696e67", "2cFupjhnEsSn59qHXstmK2ffpLv2", "BXF1HuEUCqeVzZdrKeJjG74rjeXxqJ7dW"], + ["00eb15231dfceb60925886b67d065299925915aeb172c06647", "1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L", "13REmUhe2ckUKy1FvM7AMCdtyYq831yxM3QeyEu4"], + ["516b6fcd0f", "ABnLTmg", "237LSrY9NUUas"], + ["bf4f89001e670274dd", "3SEo3LWLoPntC", "GwDDDeduj1jpykc27e"], + ["572e4794", "3EFU7m", "FamExfqCeza"], + ["ecac89cad93923c02321", "EJDM8drfXA6uyA", "2W1Yd5Zu6WGyKVtHGMrH"], + ["10c8511e", "Rt5zm", "3op3iuGMmhs"], + ["00000000000000000000", "1111111111", "111111111146Momb"], + ["", "", "3QJmnh"] +]; + +suite('basic'); + +test('allData', function() { + base58.encodeTest = function(raw, b58str) { + assert.equal(base58.encode(raw), b58str); + }; + + base58.decodeTest = function(raw, b58str) { + assert.equal(raw.toString('hex'), base58.decode(b58str).toString('hex')); + }; + + base58Check.encodeTest = function(raw, b58str) { + assert.equal(base58Check.encode(raw), b58str); + }; + + base58Check.decodeTest = function(raw, b58str) { + assert.equal(raw.toString('hex'), base58Check.decode(b58str).toString('hex')); + }; + + testData.forEach(function(datum) { + var raw = new Buffer(datum[0], 'hex'); + var b58 = datum[1]; + var b58Check = datum[2]; + + base58.encodeTest(raw, b58); + base58.decodeTest(raw, b58); + base58Check.encodeTest(raw, b58Check); + base58Check.decodeTest(raw, b58Check); + }); +}); diff --git a/node_modules/base58-native/test/mocha.opts b/node_modules/base58-native/test/mocha.opts new file mode 100644 index 0000000..e2bfcc5 --- /dev/null +++ b/node_modules/base58-native/test/mocha.opts @@ -0,0 +1 @@ +--ui qunit diff --git a/node_modules/bignum/.npmignore b/node_modules/bignum/.npmignore new file mode 100644 index 0000000..378eac2 --- /dev/null +++ b/node_modules/bignum/.npmignore @@ -0,0 +1 @@ +build diff --git a/node_modules/bignum/.travis.yml b/node_modules/bignum/.travis.yml new file mode 100644 index 0000000..4a83e22 --- /dev/null +++ b/node_modules/bignum/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.11" + - "0.10" + - "0.8" diff --git a/node_modules/bignum/README.markdown b/node_modules/bignum/README.markdown new file mode 100644 index 0000000..f28a445 --- /dev/null +++ b/node_modules/bignum/README.markdown @@ -0,0 +1,327 @@ +bignum +====== + +Arbitrary precision integral arithmetic for Node.js using +OpenSSL. + +This library is based on +[node-bigint](https://github.com/substack/node-bigint) by +[substack](https://github.com/substack), but instead of using libgmp, +it uses the builtin bignum functionality provided by OpenSSL. The +advantage is that OpenSSL is already part of Node.js, so this +library does not add any external dependency whatsoever. + +differences +=========== + +When switching from node-bigint to node-bignum, please be aware of +these differences: + +- Bignum rounds towards zero for integer divisions, e.g. `10 / -3 = -3`, whereas bigint + rounds towards negative infinity, e.g. `10 / -3 = -4`. +- Bitwise operations (and, or, xor) are implemented for positive numbers only. +- nextPrime() is not supported. +- sqrt() and root() are not supported. + +(Patches for the missing functionality are welcome.) + +example +======= + +simple.js +--------- + + var bignum = require('bignum'); + + var b = bignum('782910138827292261791972728324982') + .sub('182373273283402171237474774728373') + .div(8) + ; + console.log(b); + +*** + $ node simple.js + + +perfect.js +---------- + +Generate the perfect numbers: + + // If 2**n-1 is prime, then (2**n-1) * 2**(n-1) is perfect. + var bignum = require('bignum'); + + for (var n = 0; n < 100; n++) { + var p = bignum.pow(2, n).sub(1); + if (p.probPrime(50)) { + var perfect = p.mul(bignum.pow(2, n - 1)); + console.log(perfect.toString()); + } + } + +*** + + 6 + 28 + 496 + 8128 + 33550336 + 8589869056 + 137438691328 + 2305843008139952128 + 2658455991569831744654692615953842176 + 191561942608236107294793378084303638130997321548169216 + +methods[0] +========== + +bignum(n, base=10) +------------------ + +Create a new `bignum` from `n` and a base. `n` can be a string, integer, or +another `bignum`. + +If you pass in a string you can set the base that string is encoded in. + +.toString(base=10) +------------------ + +Print out the `bignum` instance in the requested base as a string. + +bignum.fromBuffer(buf, opts) +---------------------------- + +Create a new `bignum` from a `Buffer`. + +The default options are: + + { + endian : 'big', + size : 1, // number of bytes in each word + } + +Note that endian doesn't matter when size = 1. If you wish to reverse the entire buffer byte by byte, pass size: 'auto'. + +bignum.prime(bits, safe=true) +----------------------------- + +Generate a probable prime of length `bits`. If `safe` is true, it will be a "safe" prime of the form p=2p'+1 where p' is also prime. + +methods[1] +========== + +For all of the instance methods below you can write either + + bignum.method(x, y, z) + +or if x is a `bignum` instance`` + + x.method(y, z) + +.toNumber() +----------- + +Turn a `bignum` into a `Number`. If the `bignum` is too big you'll lose +precision or you'll get ±`Infinity`. + +.toBuffer(opts) +------------- + +Return a new `Buffer` with the data from the `bignum`. + +The default options are: + + { + endian : 'big', + size : 1, // number of bytes in each word + } + +Note that endian doesn't matter when size = 1. If you wish to reverse the entire buffer byte by byte, pass size: 'auto'. + +.add(n) +------- + +Return a new `bignum` containing the instance value plus `n`. + +.sub(n) +------- + +Return a new `bignum` containing the instance value minus `n`. + +.mul(n) +------- + +Return a new `bignum` containing the instance value multiplied by `n`. + +.div(n) +------- + +Return a new `bignum` containing the instance value integrally divided by `n`. + +.abs() +------ + +Return a new `bignum` with the absolute value of the instance. + +.neg() +------ + +Return a new `bignum` with the negative of the instance value. + +.cmp(n) +------- + +Compare the instance value to `n`. Return a positive integer if `> n`, a +negative integer if `< n`, and 0 if `== n`. + +.gt(n) +------ + +Return a boolean: whether the instance value is greater than n (`> n`). + +.ge(n) +------ + +Return a boolean: whether the instance value is greater than or equal to n +(`>= n`). + +.eq(n) +------ + +Return a boolean: whether the instance value is equal to n (`== n`). + +.lt(n) +------ + +Return a boolean: whether the instance value is less than n (`< n`). + +.le(n) +------ + +Return a boolean: whether the instance value is less than or equal to n +(`<= n`). + +.and(n) +------- + +Return a new `bignum` with the instance value bitwise AND (&)-ed with `n`. + +.or(n) +------ + +Return a new `bignum` with the instance value bitwise inclusive-OR (|)-ed with +`n`. + +.xor(n) +------- + +Return a new `bignum` with the instance value bitwise exclusive-OR (^)-ed with +`n`. + +.mod(n) +------- + +Return a new `bignum` with the instance value modulo `n`. + +`m`. +.pow(n) +------- + +Return a new `bignum` with the instance value raised to the `n`th power. + +.powm(n, m) +----------- + +Return a new `bignum` with the instance value raised to the `n`th power modulo +`m`. + +.invertm(m) +----------- + +Compute the multiplicative inverse modulo `m`. + +.rand() +------- +.rand(upperBound) +----------------- + +If `upperBound` is supplied, return a random `bignum` between the instance value +and `upperBound - 1`, inclusive. + +Otherwise, return a random `bignum` between 0 and the instance value - 1, +inclusive. + +.probPrime() +------------ + +Return whether the bignum is: + +* certainly prime (true) +* probably prime ('maybe') +* certainly composite (false) + +using [BN_is_prime_ex](http://www.openssl.org/docs/crypto/BN_generate_prime.html). + +.sqrt() +------- + +Return a new `bignum` that is the square root. This truncates. + +.root(n) +------- + +Return a new `bignum` that is the `nth` root. This truncates. + +.shiftLeft(n) +------------- + +Return a new `bignum` that is the `2^n` multiple. Equivalent of the `<<` +operator. + +.shiftRight(n) +-------------- + +Return a new `bignum` of the value integer divided by +`2^n`. Equivalent of the `>>` operator. + +.gcd(n) +------- + +Return the greatest common divisor of the current `bignum` with `n` as a new +`bignum`. + +.jacobi(n) +------- + +Return the Jacobi symbol (or Legendre symbol if `n` is prime) of the current +`bignum` (= a) over `n`. Note that `n` must be odd and >= 3. 0 <= a < n. + +Returns -1 or 1 as an int (NOT a bignum). Throws an error on failure. + +.bitLength() +------------ + +Return the number of bits used to represent the current `bignum`. + +install +======= + +To compile the package, your system needs to be set up for building Node.js +modules. + +You can install node-bignum with [npm](http://npmjs.org): + + npm install bignum + +develop +======= + +You can clone the git repo and compile with + + git clone git://github.com/justmoon/node-bignum.git + cd node-bignum + npm install + +Run the tests with + + npm test diff --git a/node_modules/bignum/bignum.cc b/node_modules/bignum/bignum.cc new file mode 100644 index 0000000..a7f047e --- /dev/null +++ b/node_modules/bignum/bignum.cc @@ -0,0 +1,972 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +using namespace v8; +using namespace node; +using namespace std; + +#define REQ_STR_ARG(I, VAR) \ + if (args.Length()<= (I) || !args[I]->IsString()) \ + return ThrowException(Exception::TypeError( \ + String::New("Argument " #I " must be a string"))); \ + Local VAR = Local::Cast(args[I]); + +#define REQ_UTF8_ARG(I, VAR) \ + if (args.Length() <= (I) || !args[I]->IsString()) \ + return ThrowException(Exception::TypeError( \ + String::New("Argument " #I " must be a utf8 string"))); \ + String::Utf8Value VAR(args[I]->ToString()); + +#define REQ_INT32_ARG(I, VAR) \ + if (args.Length() <= (I) || !args[I]->IsInt32()) \ + return ThrowException(Exception::TypeError( \ + String::New("Argument " #I " must be an int32"))); \ + int32_t VAR = args[I]->ToInt32()->Value(); + +#define REQ_UINT32_ARG(I, VAR) \ + if (args.Length() <= (I) || !args[I]->IsUint32()) \ + return ThrowException(Exception::TypeError( \ + String::New("Argument " #I " must be a uint32"))); \ + uint32_t VAR = args[I]->ToUint32()->Value(); + +#define REQ_INT64_ARG(I, VAR) \ + if (args.Length() <= (I) || !args[I]->IsNumber()) \ + return ThrowException(Exception::TypeError( \ + String::New("Argument " #I " must be an int64"))); \ + int64_t VAR = args[I]->ToInteger()->Value(); + +#define REQ_UINT64_ARG(I, VAR) \ + if (args.Length() <= (I) || !args[I]->IsNumber()) \ + return ThrowException(Exception::TypeError( \ + String::New("Argument " #I " must be a uint64"))); \ + uint64_t VAR = args[I]->ToInteger()->Value(); + +#define REQ_BOOL_ARG(I, VAR) \ + if (args.Length() <= (I) || !args[I]->IsBoolean()) \ + return ThrowException(Exception::TypeError( \ + String::New("Argument " #I " must be a boolean"))); \ + bool VAR = args[I]->ToBoolean()->Value(); + +#define WRAP_RESULT(RES, VAR) \ + Handle arg[1] = { External::New(static_cast(RES)) }; \ + Local VAR = constructor_template->GetFunction()->NewInstance(1, arg); + +class AutoBN_CTX +{ +protected: + BN_CTX* ctx; + BN_CTX* operator=(BN_CTX* ctx_new) { return ctx = ctx_new; } + +public: + AutoBN_CTX() + { + ctx = BN_CTX_new(); + // TODO: Handle ctx == NULL + } + + ~AutoBN_CTX() + { + if (ctx != NULL) + BN_CTX_free(ctx); + } + + operator BN_CTX*() { return ctx; } + BN_CTX& operator*() { return *ctx; } + BN_CTX** operator&() { return &ctx; } + bool operator!() { return (ctx == NULL); } +}; + +/** + * BN_jacobi_priv() computes the Jacobi symbol of A with respect to N. + * + * Hence, *jacobi = 1 when the jacobi symbol is unity and *jacobi = -1 when the + * jacobi symbol is -1. N must be odd and >= 3. It is required that 0 <= A < N. + * + * When successful 0 is returned. -1 is returned on failure. + * + * This is an implementation of an iterative version of Algorithm 2.149 on page + * 73 of the book "Handbook of Applied Cryptography" by Menezes, Oorshot, + * Vanstone. Note that there is a typo in step 1. Step 1 should return the value + * 1. The algorithm has a running time of O((lg N)^2) bit operations. + * + * @author Adam L. Young + */ +int BN_jacobi_priv(const BIGNUM *A,const BIGNUM *N,int *jacobi, + BN_CTX *ctx) +{ + int e,returnvalue=0,s,bit0,bit1,bit2,a1bit0,a1bit1; + BIGNUM *zero,*a1,*n1,*three,*tmp; + + if (!jacobi) + return -1; + *jacobi = 1; + if ((!A) || (!N) || (!ctx)) + return -1; + if (!BN_is_odd(N)) + return -1; /* ERROR: BN_jacobi() given an even N */ + if (BN_cmp(A,N) >= 0) + return -1; + n1=BN_new();zero=BN_new();a1=BN_new();three=BN_new();tmp=BN_new(); + BN_set_word(zero,0); + BN_set_word(three,3); + if (BN_cmp(N,three) < 0) + { /* This function was written by Adam L. Young */ + returnvalue = -1; + goto endBN_jacobi; + } + if (BN_cmp(zero,A) > 0) + { + returnvalue = -1; + goto endBN_jacobi; + } + BN_copy(a1,A); + BN_copy(n1,N); +startjacobistep1: + if (BN_is_zero(a1)) /* step 1 */ + goto endBN_jacobi; /* *jacobi = 1; */ + if (BN_is_one(a1)) /* step 2 */ + goto endBN_jacobi; /* *jacobi = 1; */ + for (e=0;;e++) /* step 3 */ + if (BN_is_odd(a1)) + break; + else + BN_rshift1(a1,a1); + s = 1; /* step 4 */ + bit0 = BN_is_odd(n1); + bit1 = BN_is_bit_set(n1,1); + if (e % 2) + { + bit2 = BN_is_bit_set(n1,2); + if ((!bit2) && (bit1) && (bit0)) + s = -1; + if ((bit2) && (!bit1) && (bit0)) + s = -1; + } + a1bit0 = BN_is_odd(a1); /* step 5 */ + a1bit1 = BN_is_bit_set(a1,1); + if (((bit1) && (bit0)) && ((a1bit1) && (a1bit0))) + s = -s; + BN_mod(n1,n1,a1,ctx); /* step 6 */ + BN_copy(tmp,a1); + BN_copy(a1,n1); + BN_copy(n1,tmp); + *jacobi *= s; /* step 7 */ + goto startjacobistep1; +endBN_jacobi: + BN_clear_free(zero); + BN_clear_free(tmp);BN_clear_free(a1); + BN_clear_free(n1);BN_clear_free(three); + return returnvalue; +} + +class BigNum : ObjectWrap { +public: + static void Initialize(Handle target); + BIGNUM bignum_; + static Persistent js_conditioner; + static void SetJSConditioner(Persistent constructor); + +protected: + static Persistent constructor_template; + + BigNum(const String::Utf8Value& str, uint64_t base); + BigNum(uint64_t num); + BigNum(int64_t num); + BigNum(BIGNUM *num); + BigNum(); + ~BigNum(); + + static Handle New(const Arguments& args); + static Handle ToString(const Arguments& args); + static Handle Badd(const Arguments& args); + static Handle Bsub(const Arguments& args); + static Handle Bmul(const Arguments& args); + static Handle Bdiv(const Arguments& args); + static Handle Uadd(const Arguments& args); + static Handle Usub(const Arguments& args); + static Handle Umul(const Arguments& args); + static Handle Udiv(const Arguments& args); + static Handle Umul_2exp(const Arguments& args); + static Handle Udiv_2exp(const Arguments& args); + static Handle Babs(const Arguments& args); + static Handle Bneg(const Arguments& args); + static Handle Bmod(const Arguments& args); + static Handle Umod(const Arguments& args); + static Handle Bpowm(const Arguments& args); + static Handle Upowm(const Arguments& args); + static Handle Upow(const Arguments& args); + static Handle Uupow(const Arguments& args); + static Handle Brand0(const Arguments& args); + static Handle Uprime0(const Arguments& args); + static Handle Probprime(const Arguments& args); + static Handle Bcompare(const Arguments& args); + static Handle Scompare(const Arguments& args); + static Handle Ucompare(const Arguments& args); + static Handle Bop(const Arguments& args, int op); + static Handle Band(const Arguments& args); + static Handle Bor(const Arguments& args); + static Handle Bxor(const Arguments& args); + static Handle Binvertm(const Arguments& args); + static Handle Bsqrt(const Arguments& args); + static Handle Broot(const Arguments& args); + static Handle BitLength(const Arguments& args); + static Handle Bgcd(const Arguments& args); + static Handle Bjacobi(const Arguments& args); +}; + +Persistent BigNum::constructor_template; + +Persistent BigNum::js_conditioner; + +void BigNum::SetJSConditioner(Persistent constructor) { + js_conditioner = constructor; +} + +void BigNum::Initialize(v8::Handle target) { + HandleScope scope; + + Local t = FunctionTemplate::New(New); + constructor_template = Persistent::New(t); + + constructor_template->InstanceTemplate()->SetInternalFieldCount(1); + constructor_template->SetClassName(String::NewSymbol("BigNum")); + + NODE_SET_METHOD(constructor_template, "uprime0", Uprime0); + + NODE_SET_PROTOTYPE_METHOD(constructor_template, "tostring", ToString); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "badd", Badd); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "bsub", Bsub); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "bmul", Bmul); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "bdiv", Bdiv); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "uadd", Uadd); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "usub", Usub); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "umul", Umul); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "udiv", Udiv); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "umul2exp", Umul_2exp); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "udiv2exp", Udiv_2exp); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "babs", Babs); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "bneg", Bneg); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "bmod", Bmod); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "umod", Umod); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "bpowm", Bpowm); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "upowm", Upowm); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "upow", Upow); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "brand0", Brand0); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "probprime", Probprime); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "bcompare", Bcompare); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "scompare", Scompare); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "ucompare", Ucompare); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "band", Band); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "bor", Bor); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "bxor", Bxor); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "binvertm", Binvertm); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "bsqrt", Bsqrt); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "broot", Broot); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "bitLength", BitLength); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "gcd", Bgcd); + NODE_SET_PROTOTYPE_METHOD(constructor_template, "jacobi", Bjacobi); + + target->Set(String::NewSymbol("BigNum"), constructor_template->GetFunction()); +} + +BigNum::BigNum(const v8::String::Utf8Value& str, uint64_t base) : ObjectWrap () +{ + BN_init(&bignum_); + BN_zero(&bignum_); + + BIGNUM *res = &bignum_; + + const char *cstr = *str; + switch (base) { + case 2: + BN_init(&bignum_); + for (int i = 0, l = str.length(); i < l; i++) { + if (cstr[l-i-1] != '0') { + BN_set_bit(&bignum_, i); + } + } + break; + case 10: + BN_dec2bn(&res, cstr); + break; + case 16: + BN_hex2bn(&res, cstr); + break; + default: + ThrowException(Exception::Error(String::New("Invalid base, only 10 and 16 are supported"))); + return; + } +} + +BigNum::BigNum(uint64_t num) : ObjectWrap () +{ + BN_init(&bignum_); + + BN_set_word(&bignum_, num); +} + +BigNum::BigNum(int64_t num) : ObjectWrap () +{ + BN_init(&bignum_); + + if (num > 0) { + BN_set_word(&bignum_, num); + } else { + BN_set_word(&bignum_, -num); + BN_set_negative(&bignum_, 1); + } +} + +BigNum::BigNum(BIGNUM *num) : ObjectWrap () +{ + BN_init(&bignum_); + BN_copy(&bignum_, num); +} + +BigNum::BigNum() : ObjectWrap () +{ + BN_init(&bignum_); + BN_zero(&bignum_); +} + +BigNum::~BigNum() +{ + BN_clear_free(&bignum_); +} + +Handle +BigNum::New(const Arguments& args) +{ + if (!args.IsConstructCall()) { + int len = args.Length(); + Handle* newArgs = new Handle[len]; + for (int i = 0; i < len; i++) { + newArgs[i] = args[i]; + } + Handle newInst = constructor_template->GetFunction()->NewInstance(len, newArgs); + delete[] newArgs; + return newInst; + } + HandleScope scope; + BigNum *bignum; + uint64_t base; + + if (args[0]->IsExternal()) { + bignum = static_cast(External::Cast(*(args[0]))->Value()); + } else { + int len = args.Length(); + Local ctx = Local::New(Object::New()); + Handle* newArgs = new Handle[len]; + for (int i = 0; i < len; i++) { + newArgs[i] = args[i]; + } + Local obj = js_conditioner->Call(ctx, args.Length(), newArgs); + delete[] newArgs; + + if (!*obj) { + return ThrowException(Exception::Error(String::New("Invalid type passed to bignum constructor"))); + } + + String::Utf8Value str(obj->ToObject()->Get(String::NewSymbol("num"))->ToString()); + base = obj->ToObject()->Get(String::NewSymbol("base"))->ToNumber()->Value(); + + bignum = new BigNum(str, base); + } + + bignum->Wrap(args.This()); + + return scope.Close(args.This()); +} + +Handle +BigNum::ToString(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + uint64_t base = 10; + + if (args.Length() > 0) { + REQ_UINT64_ARG(0, tbase); + base = tbase; + } + char *to = NULL; + switch (base) { + case 10: + to = BN_bn2dec(&bignum->bignum_); + break; + case 16: + to = BN_bn2hex(&bignum->bignum_); + break; + default: + return ThrowException(Exception::Error(String::New("Invalid base, only 10 and 16 are supported"))); + } + + Handle result = String::New(to); + free(to); + + return scope.Close(result); +} + +Handle +BigNum::Badd(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + BigNum *bn = ObjectWrap::Unwrap(args[0]->ToObject()); + BigNum *res = new BigNum(); + + BN_add(&res->bignum_, &bignum->bignum_, &bn->bignum_); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Bsub(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + BigNum *bn = ObjectWrap::Unwrap(args[0]->ToObject()); + BigNum *res = new BigNum(); + BN_sub(&res->bignum_, &bignum->bignum_, &bn->bignum_); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Bmul(const Arguments& args) +{ + AutoBN_CTX ctx; + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + BigNum *bn = ObjectWrap::Unwrap(args[0]->ToObject()); + BigNum *res = new BigNum(); + BN_mul(&res->bignum_, &bignum->bignum_, &bn->bignum_, ctx); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Bdiv(const Arguments& args) +{ + AutoBN_CTX ctx; + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + BigNum *bi = ObjectWrap::Unwrap(args[0]->ToObject()); + BigNum *res = new BigNum(); + BN_div(&res->bignum_, NULL, &bignum->bignum_, &bi->bignum_, ctx); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Uadd(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + REQ_UINT64_ARG(0, x); + BigNum *res = new BigNum(&bignum->bignum_); + BN_add_word(&res->bignum_, x); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Usub(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + REQ_UINT64_ARG(0, x); + BigNum *res = new BigNum(&bignum->bignum_); + BN_sub_word(&res->bignum_, x); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Umul(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + REQ_UINT64_ARG(0, x); + BigNum *res = new BigNum(&bignum->bignum_); + BN_mul_word(&res->bignum_, x); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Udiv(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + REQ_UINT64_ARG(0, x); + BigNum *res = new BigNum(&bignum->bignum_); + BN_div_word(&res->bignum_, x); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Umul_2exp(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + REQ_UINT64_ARG(0, x); + BigNum *res = new BigNum(); + BN_lshift(&res->bignum_, &bignum->bignum_, x); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Udiv_2exp(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + REQ_UINT64_ARG(0, x); + BigNum *res = new BigNum(); + BN_rshift(&res->bignum_, &bignum->bignum_, x); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Babs(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + BigNum *res = new BigNum(&bignum->bignum_); + BN_set_negative(&res->bignum_, 0); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Bneg(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + BigNum *res = new BigNum(&bignum->bignum_); + BN_set_negative(&res->bignum_, !BN_is_negative(&res->bignum_)); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Bmod(const Arguments& args) +{ + AutoBN_CTX ctx; + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + BigNum *bn = ObjectWrap::Unwrap(args[0]->ToObject()); + BigNum *res = new BigNum(); + BN_div(NULL, &res->bignum_, &bignum->bignum_, &bn->bignum_, ctx); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Umod(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + REQ_UINT64_ARG(0, x); + BigNum *res = new BigNum(); + BN_set_word(&res->bignum_, BN_mod_word(&bignum->bignum_, x)); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Bpowm(const Arguments& args) +{ + AutoBN_CTX ctx; + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + BigNum *bn1 = ObjectWrap::Unwrap(args[0]->ToObject()); + BigNum *bn2 = ObjectWrap::Unwrap(args[1]->ToObject()); + BigNum *res = new BigNum(); + BN_mod_exp(&res->bignum_, &bignum->bignum_, &bn1->bignum_, &bn2->bignum_, ctx); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Upowm(const Arguments& args) +{ + AutoBN_CTX ctx; + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + REQ_UINT64_ARG(0, x); + BigNum *bn = ObjectWrap::Unwrap(args[1]->ToObject()); + BIGNUM exp; + BN_init(&exp); + BN_set_word(&exp, x); + + BigNum *res = new BigNum(); + BN_mod_exp(&res->bignum_, &bignum->bignum_, &exp, &bn->bignum_, ctx); + + BN_clear_free(&exp); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Upow(const Arguments& args) +{ + AutoBN_CTX ctx; + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + REQ_UINT64_ARG(0, x); + BIGNUM exp; + BN_init(&exp); + BN_set_word(&exp, x); + + BigNum *res = new BigNum(); + BN_exp(&res->bignum_, &bignum->bignum_, &exp, ctx); + + BN_clear_free(&exp); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Brand0(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + BigNum *res = new BigNum(); + + BN_rand_range(&res->bignum_, &bignum->bignum_); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Uprime0(const Arguments& args) +{ + HandleScope scope; + + REQ_UINT32_ARG(0, x); + REQ_BOOL_ARG(1, safe); + + BigNum *res = new BigNum(); + + BN_generate_prime_ex(&res->bignum_, x, safe, NULL, NULL, NULL); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Probprime(const Arguments& args) +{ + AutoBN_CTX ctx; + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + REQ_UINT32_ARG(0, reps); + + return scope.Close(Number::New(BN_is_prime_ex(&bignum->bignum_, reps, ctx, NULL))); +} + +Handle +BigNum::Bcompare(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + BigNum *bn = ObjectWrap::Unwrap(args[0]->ToObject()); + + return scope.Close(Number::New(BN_cmp(&bignum->bignum_, &bn->bignum_))); +} + +Handle +BigNum::Scompare(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + REQ_INT64_ARG(0, x); + BIGNUM bn; + BN_init(&bn); + if (x > 0) { + BN_set_word(&bn, x); + } else { + BN_set_word(&bn, -x); + BN_set_negative(&bn, 1); + } + int res = BN_cmp(&bignum->bignum_, &bn); + BN_clear_free(&bn); + + return scope.Close(Number::New(res)); +} + +Handle +BigNum::Ucompare(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + REQ_UINT64_ARG(0, x); + BIGNUM bn; + BN_init(&bn); + BN_set_word(&bn, x); + int res = BN_cmp(&bignum->bignum_, &bn); + BN_clear_free(&bn); + + return scope.Close(Number::New(res)); +} + +Handle +BigNum::Bop(const Arguments& args, int op) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + BigNum *bn = ObjectWrap::Unwrap(args[0]->ToObject()); + HandleScope scope; + + if (BN_is_negative(&bignum->bignum_) || BN_is_negative(&bn->bignum_)) { + // Using BN_bn2mpi and BN_bn2mpi would make this more manageable; added in SSLeay 0.9.0 + return ThrowException(Exception::Error(String::New("Bitwise operations on negative numbers are not supported"))); + } + + BigNum *res = new BigNum(); + + // Modified from https://github.com/Worlize/WebSocket-Node/blob/master/src/xor.cpp + // Portions Copyright (c) Agora S.A. + // Licensed under the MIT License. + + int payloadSize = BN_num_bytes(&bignum->bignum_); + int maskSize = BN_num_bytes(&bn->bignum_); + + int size = max(payloadSize, maskSize); + int offset = abs(payloadSize - maskSize); + + int payloadOffset = 0; + int maskOffset = 0; + + if (payloadSize < maskSize) { + payloadOffset = offset; + } else if (payloadSize > maskSize) { + maskOffset = offset; + } + + uint8_t* payload = (uint8_t*) calloc(size, sizeof(char)); + uint8_t* mask = (uint8_t*) calloc(size, sizeof(char)); + + BN_bn2bin(&bignum->bignum_, (unsigned char*) (payload + payloadOffset)); + BN_bn2bin(&bn->bignum_, (unsigned char*) (mask + maskOffset)); + + uint32_t* pos32 = (uint32_t*) payload; + uint32_t* end32 = pos32 + (size / 4); + uint32_t* mask32 = (uint32_t*) mask; + + switch (op) { + case 0: while (pos32 < end32) *(pos32++) &= *(mask32++); break; + case 1: while (pos32 < end32) *(pos32++) |= *(mask32++); break; + case 2: while (pos32 < end32) *(pos32++) ^= *(mask32++); break; + } + + uint8_t* pos8 = (uint8_t*) pos32; + uint8_t* end8 = payload + size; + uint8_t* mask8 = (uint8_t*) mask32; + + switch (op) { + case 0: while (pos8 < end8) *(pos8++) &= *(mask8++); break; + case 1: while (pos8 < end8) *(pos8++) |= *(mask8++); break; + case 2: while (pos8 < end8) *(pos8++) ^= *(mask8++); break; + } + + BN_bin2bn((unsigned char*) payload, size, &res->bignum_); + + WRAP_RESULT(res, result); + + free(payload); + free(mask); + + return scope.Close(result); +} + +Handle +BigNum::Band(const Arguments& args) +{ + return Bop(args, 0); +} + +Handle +BigNum::Bor(const Arguments& args) +{ + return Bop(args, 1); +} + +Handle +BigNum::Bxor(const Arguments& args) +{ + return Bop(args, 2); +} + +Handle +BigNum::Binvertm(const Arguments& args) +{ + AutoBN_CTX ctx; + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + BigNum *bn = ObjectWrap::Unwrap(args[0]->ToObject()); + BigNum *res = new BigNum(); + BN_mod_inverse(&res->bignum_, &bignum->bignum_, &bn->bignum_, ctx); + + WRAP_RESULT(res, result); + + return scope.Close(result); +} + +Handle +BigNum::Bsqrt(const Arguments& args) +{ + //BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + return ThrowException(Exception::Error(String::New("sqrt is not supported by OpenSSL."))); +} + +Handle +BigNum::Broot(const Arguments& args) +{ + //BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + return ThrowException(Exception::Error(String::New("root is not supported by OpenSSL."))); +} + +Handle +BigNum::BitLength(const Arguments& args) +{ + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + int size = BN_num_bits(&bignum->bignum_); + Handle result = Integer::New(size); + + return scope.Close(result); +} + +Handle +BigNum::Bgcd(const Arguments& args) +{ + AutoBN_CTX ctx; + BigNum *bignum = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + BigNum *bi = ObjectWrap::Unwrap(args[0]->ToObject()); + BigNum *res = new BigNum(); + + BN_gcd(&res->bignum_, &bignum->bignum_, &bi->bignum_, ctx); + + WRAP_RESULT(res, result); + return scope.Close(result); +} + +Handle +BigNum::Bjacobi(const Arguments& args) +{ + AutoBN_CTX ctx; + BigNum *bn_a = ObjectWrap::Unwrap(args.This()); + HandleScope scope; + + BigNum *bn_n = ObjectWrap::Unwrap(args[0]->ToObject()); + int res = 0; + + if (BN_jacobi_priv(&bn_a->bignum_, &bn_n->bignum_, &res, ctx) == -1) + return ThrowException(Exception::Error(String::New( + "Jacobi symbol calculation failed"))); + + return scope.Close(Integer::New(res)); +} + +static Handle +SetJSConditioner(const Arguments& args) +{ + HandleScope scope; + + BigNum::SetJSConditioner(Persistent::New(Local::Cast(args[0]))); + + return Undefined(); +} + +extern "C" void +init (Handle target) +{ + HandleScope scope; + + BigNum::Initialize(target); + NODE_SET_METHOD(target, "setJSConditioner", SetJSConditioner); +} + +NODE_MODULE(bignum, init) diff --git a/node_modules/bignum/binding.gyp b/node_modules/bignum/binding.gyp new file mode 100644 index 0000000..41426f3 --- /dev/null +++ b/node_modules/bignum/binding.gyp @@ -0,0 +1,79 @@ +{ + 'targets': + [ + { + 'target_name': 'bignum', + 'sources': [ 'bignum.cc' ], + 'conditions': + [ + + # For Windows, require either a 32-bit or 64-bit + # separately-compiled OpenSSL library. + # Currently set up to use with the following OpenSSL distro: + # + # http://slproweb.com/products/Win32OpenSSL.html + [ + 'OS=="win"', + { + 'conditions': + [ + [ + 'target_arch=="x64"', + { + 'variables': { + 'openssl_root%': 'C:/OpenSSL-Win64' + }, + }, { + 'variables': { + 'openssl_root%': 'C:/OpenSSL-Win32' + } + } + ] + ], + 'libraries': [ + '-l<(openssl_root)/lib/libeay32.lib', + ], + 'include_dirs': [ + '<(openssl_root)/include', + ], + }, + + + # Otherwise, if not Windows, link against the exposed OpenSSL + # in Node. + { + 'conditions': + [ + [ + 'target_arch=="ia32"', + { + 'variables': { + 'openssl_config_path': '<(nodedir)/deps/openssl/config/piii' + } + } + ], + [ + 'target_arch=="x64"', { + 'variables': { + 'openssl_config_path': '<(nodedir)/deps/openssl/config/k8' + }, + } + ], + [ + 'target_arch=="arm"', { + 'variables': { + 'openssl_config_path': '<(nodedir)/deps/openssl/config/arm' + } + } + ], + ], + 'include_dirs': [ + "<(nodedir)/deps/openssl/openssl/include", + "<(openssl_config_path)" + ] + } + ] + ] + } + ] +} diff --git a/node_modules/bignum/build/Makefile b/node_modules/bignum/build/Makefile new file mode 100644 index 0000000..4852432 --- /dev/null +++ b/node_modules/bignum/build/Makefile @@ -0,0 +1,332 @@ +# We borrow heavily from the kernel build setup, though we are simpler since +# we don't have Kconfig tweaking settings on us. + +# The implicit make rules have it looking for RCS files, among other things. +# We instead explicitly write all the rules we care about. +# It's even quicker (saves ~200ms) to pass -r on the command line. +MAKEFLAGS=-r + +# The source directory tree. +srcdir := .. +abs_srcdir := $(abspath $(srcdir)) + +# The name of the builddir. +builddir_name ?= . + +# The V=1 flag on command line makes us verbosely print command lines. +ifdef V + quiet= +else + quiet=quiet_ +endif + +# Specify BUILDTYPE=Release on the command line for a release build. +BUILDTYPE ?= Release + +# Directory all our build output goes into. +# Note that this must be two directories beneath src/ for unit tests to pass, +# as they reach into the src/ directory for data with relative paths. +builddir ?= $(builddir_name)/$(BUILDTYPE) +abs_builddir := $(abspath $(builddir)) +depsdir := $(builddir)/.deps + +# Object output directory. +obj := $(builddir)/obj +abs_obj := $(abspath $(obj)) + +# We build up a list of every single one of the targets so we can slurp in the +# generated dependency rule Makefiles in one pass. +all_deps := + + + +CC.target ?= $(CC) +CFLAGS.target ?= $(CFLAGS) +CXX.target ?= $(CXX) +CXXFLAGS.target ?= $(CXXFLAGS) +LINK.target ?= $(LINK) +LDFLAGS.target ?= $(LDFLAGS) +AR.target ?= $(AR) + +# C++ apps need to be linked with g++. +# +# Note: flock is used to seralize linking. Linking is a memory-intensive +# process so running parallel links can often lead to thrashing. To disable +# the serialization, override LINK via an envrionment variable as follows: +# +# export LINK=g++ +# +# This will allow make to invoke N linker processes as specified in -jN. +LINK ?= flock $(builddir)/linker.lock $(CXX.target) + +# TODO(evan): move all cross-compilation logic to gyp-time so we don't need +# to replicate this environment fallback in make as well. +CC.host ?= gcc +CFLAGS.host ?= +CXX.host ?= g++ +CXXFLAGS.host ?= +LINK.host ?= $(CXX.host) +LDFLAGS.host ?= +AR.host ?= ar + +# Define a dir function that can handle spaces. +# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions +# "leading spaces cannot appear in the text of the first argument as written. +# These characters can be put into the argument value by variable substitution." +empty := +space := $(empty) $(empty) + +# http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces +replace_spaces = $(subst $(space),?,$1) +unreplace_spaces = $(subst ?,$(space),$1) +dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1))) + +# Flags to make gcc output dependency info. Note that you need to be +# careful here to use the flags that ccache and distcc can understand. +# We write to a dep file on the side first and then rename at the end +# so we can't end up with a broken dep file. +depfile = $(depsdir)/$(call replace_spaces,$@).d +DEPFLAGS = -MMD -MF $(depfile).raw + +# We have to fixup the deps output in a few ways. +# (1) the file output should mention the proper .o file. +# ccache or distcc lose the path to the target, so we convert a rule of +# the form: +# foobar.o: DEP1 DEP2 +# into +# path/to/foobar.o: DEP1 DEP2 +# (2) we want missing files not to cause us to fail to build. +# We want to rewrite +# foobar.o: DEP1 DEP2 \ +# DEP3 +# to +# DEP1: +# DEP2: +# DEP3: +# so if the files are missing, they're just considered phony rules. +# We have to do some pretty insane escaping to get those backslashes +# and dollar signs past make, the shell, and sed at the same time. +# Doesn't work with spaces, but that's fine: .d files have spaces in +# their names replaced with other characters. +define fixup_dep +# The depfile may not exist if the input file didn't have any #includes. +touch $(depfile).raw +# Fixup path as in (1). +sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile) +# Add extra rules as in (2). +# We remove slashes and replace spaces with new lines; +# remove blank lines; +# delete the first line and append a colon to the remaining lines. +sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ + grep -v '^$$' |\ + sed -e 1d -e 's|$$|:|' \ + >> $(depfile) +rm $(depfile).raw +endef + +# Command definitions: +# - cmd_foo is the actual command to run; +# - quiet_cmd_foo is the brief-output summary of the command. + +quiet_cmd_cc = CC($(TOOLSET)) $@ +cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $< + +quiet_cmd_cxx = CXX($(TOOLSET)) $@ +cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< + +quiet_cmd_touch = TOUCH $@ +cmd_touch = touch $@ + +quiet_cmd_copy = COPY $@ +# send stderr to /dev/null to ignore messages when linking directories. +cmd_copy = rm -rf "$@" && cp -af "$<" "$@" + +quiet_cmd_alink = AR($(TOOLSET)) $@ +cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) + +quiet_cmd_alink_thin = AR($(TOOLSET)) $@ +cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) + +# Due to circular dependencies between libraries :(, we wrap the +# special "figure out circular dependencies" flags around the entire +# input list during linking. +quiet_cmd_link = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) + +# We support two kinds of shared objects (.so): +# 1) shared_library, which is just bundling together many dependent libraries +# into a link line. +# 2) loadable_module, which is generating a module intended for dlopen(). +# +# They differ only slightly: +# In the former case, we want to package all dependent code into the .so. +# In the latter case, we want to package just the API exposed by the +# outermost module. +# This means shared_library uses --whole-archive, while loadable_module doesn't. +# (Note that --whole-archive is incompatible with the --start-group used in +# normal linking.) + +# Other shared-object link notes: +# - Set SONAME to the library filename so our binaries don't reference +# the local, absolute paths used on the link command-line. +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) + + +# Define an escape_quotes function to escape single quotes. +# This allows us to handle quotes properly as long as we always use +# use single quotes and escape_quotes. +escape_quotes = $(subst ','\'',$(1)) +# This comment is here just to include a ' to unconfuse syntax highlighting. +# Define an escape_vars function to escape '$' variable syntax. +# This allows us to read/write command lines with shell variables (e.g. +# $LD_LIBRARY_PATH), without triggering make substitution. +escape_vars = $(subst $$,$$$$,$(1)) +# Helper that expands to a shell command to echo a string exactly as it is in +# make. This uses printf instead of echo because printf's behaviour with respect +# to escape sequences is more portable than echo's across different shells +# (e.g., dash, bash). +exact_echo = printf '%s\n' '$(call escape_quotes,$(1))' + +# Helper to compare the command we're about to run against the command +# we logged the last time we ran the command. Produces an empty +# string (false) when the commands match. +# Tricky point: Make has no string-equality test function. +# The kernel uses the following, but it seems like it would have false +# positives, where one string reordered its arguments. +# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ +# $(filter-out $(cmd_$@), $(cmd_$(1)))) +# We instead substitute each for the empty string into the other, and +# say they're equal if both substitutions produce the empty string. +# .d files contain ? instead of spaces, take that into account. +command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\ + $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) + +# Helper that is non-empty when a prerequisite changes. +# Normally make does this implicitly, but we force rules to always run +# so we can check their command lines. +# $? -- new prerequisites +# $| -- order-only dependencies +prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) + +# Helper that executes all postbuilds until one fails. +define do_postbuilds + @E=0;\ + for p in $(POSTBUILDS); do\ + eval $$p;\ + E=$$?;\ + if [ $$E -ne 0 ]; then\ + break;\ + fi;\ + done;\ + if [ $$E -ne 0 ]; then\ + rm -rf "$@";\ + exit $$E;\ + fi +endef + +# do_cmd: run a command via the above cmd_foo names, if necessary. +# Should always run for a given target to handle command-line changes. +# Second argument, if non-zero, makes it do asm/C/C++ dependency munging. +# Third argument, if non-zero, makes it do POSTBUILDS processing. +# Note: We intentionally do NOT call dirx for depfile, since it contains ? for +# spaces already and dirx strips the ? characters. +define do_cmd +$(if $(or $(command_changed),$(prereq_changed)), + @$(call exact_echo, $($(quiet)cmd_$(1))) + @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" + $(if $(findstring flock,$(word 1,$(cmd_$1))), + @$(cmd_$(1)) + @echo " $(quiet_cmd_$(1)): Finished", + @$(cmd_$(1)) + ) + @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) + @$(if $(2),$(fixup_dep)) + $(if $(and $(3), $(POSTBUILDS)), + $(call do_postbuilds) + ) +) +endef + +# Declare the "all" target first so it is the default, +# even though we don't have the deps yet. +.PHONY: all +all: + +# make looks for ways to re-generate included makefiles, but in our case, we +# don't have a direct way. Explicitly telling make that it has nothing to do +# for them makes it go faster. +%.d: ; + +# Use FORCE_DO_CMD to force a target to run. Should be coupled with +# do_cmd. +.PHONY: FORCE_DO_CMD +FORCE_DO_CMD: + +TOOLSET := target +# Suffix rules, putting all outputs into $(obj). +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD + @$(call do_cmd,cc,1) + +# Try building from generated source, too. +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD + @$(call do_cmd,cc,1) + +$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD + @$(call do_cmd,cc,1) + + +ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ + $(findstring $(join ^,$(prefix)),\ + $(join ^,bignum.target.mk)))),) + include bignum.target.mk +endif + +quiet_cmd_regen_makefile = ACTION Regenerating $@ +cmd_regen_makefile = cd $(srcdir); /usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/home/matt/site/node_modules/bignum/build/config.gypi -I/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/home/matt/.node-gyp/0.10.24/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/home/matt/.node-gyp/0.10.24" "-Dmodule_root_dir=/home/matt/site/node_modules/bignum" binding.gyp +Makefile: $(srcdir)/../../../.node-gyp/0.10.24/common.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi + $(call do_cmd,regen_makefile) + +# "all" is a concatenation of the "all" targets from all the included +# sub-makefiles. This is just here to clarify. +all: + +# Add in dependency-tracking rules. $(all_deps) is the list of every single +# target in our tree. Only consider the ones with .d (dependency) info: +d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) +ifneq ($(d_files),) + include $(d_files) +endif diff --git a/node_modules/bignum/build/Release/.deps/Release/bignum.node.d b/node_modules/bignum/build/Release/.deps/Release/bignum.node.d new file mode 100644 index 0000000..cf8a4e6 --- /dev/null +++ b/node_modules/bignum/build/Release/.deps/Release/bignum.node.d @@ -0,0 +1 @@ +cmd_Release/bignum.node := rm -rf "Release/bignum.node" && cp -af "Release/obj.target/bignum.node" "Release/bignum.node" diff --git a/node_modules/bignum/build/Release/.deps/Release/obj.target/bignum.node.d b/node_modules/bignum/build/Release/.deps/Release/obj.target/bignum.node.d new file mode 100644 index 0000000..074929f --- /dev/null +++ b/node_modules/bignum/build/Release/.deps/Release/obj.target/bignum.node.d @@ -0,0 +1 @@ +cmd_Release/obj.target/bignum.node := flock ./Release/linker.lock g++ -shared -pthread -rdynamic -m64 -Wl,-soname=bignum.node -o Release/obj.target/bignum.node -Wl,--start-group Release/obj.target/bignum/bignum.o -Wl,--end-group diff --git a/node_modules/bignum/build/Release/.deps/Release/obj.target/bignum/bignum.o.d b/node_modules/bignum/build/Release/.deps/Release/obj.target/bignum/bignum.o.d new file mode 100644 index 0000000..69f952c --- /dev/null +++ b/node_modules/bignum/build/Release/.deps/Release/obj.target/bignum/bignum.o.d @@ -0,0 +1,59 @@ +cmd_Release/obj.target/bignum/bignum.o := g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/matt/.node-gyp/0.10.24/src -I/home/matt/.node-gyp/0.10.24/deps/uv/include -I/home/matt/.node-gyp/0.10.24/deps/v8/include -I/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include -I/home/matt/.node-gyp/0.10.24/deps/openssl/config/k8 -fPIC -Wall -Wextra -Wno-unused-parameter -pthread -m64 -O2 -fno-strict-aliasing -fno-tree-vrp -fno-omit-frame-pointer -fno-rtti -fno-exceptions -MMD -MF ./Release/.deps/Release/obj.target/bignum/bignum.o.d.raw -c -o Release/obj.target/bignum/bignum.o ../bignum.cc +Release/obj.target/bignum/bignum.o: ../bignum.cc \ + /home/matt/.node-gyp/0.10.24/deps/v8/include/v8.h \ + /home/matt/.node-gyp/0.10.24/deps/v8/include/v8stdint.h \ + /home/matt/.node-gyp/0.10.24/src/node.h \ + /home/matt/.node-gyp/0.10.24/deps/uv/include/uv.h \ + /home/matt/.node-gyp/0.10.24/deps/uv/include/uv-private/uv-unix.h \ + /home/matt/.node-gyp/0.10.24/deps/uv/include/uv-private/ngx-queue.h \ + /home/matt/.node-gyp/0.10.24/deps/uv/include/uv-private/uv-linux.h \ + /home/matt/.node-gyp/0.10.24/src/node_object_wrap.h \ + /home/matt/.node-gyp/0.10.24/src/node.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/bn.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/bn/bn.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/e_os2.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../e_os2.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/opensslconf.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/opensslconf.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/../../config/opensslconf.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/ossl_typ.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/ossl_typ.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/crypto.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/crypto.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/stack.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/stack/stack.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/safestack.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/stack/safestack.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/opensslv.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/opensslv.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/symhacks.h \ + /home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/symhacks.h +../bignum.cc: +/home/matt/.node-gyp/0.10.24/deps/v8/include/v8.h: +/home/matt/.node-gyp/0.10.24/deps/v8/include/v8stdint.h: +/home/matt/.node-gyp/0.10.24/src/node.h: +/home/matt/.node-gyp/0.10.24/deps/uv/include/uv.h: +/home/matt/.node-gyp/0.10.24/deps/uv/include/uv-private/uv-unix.h: +/home/matt/.node-gyp/0.10.24/deps/uv/include/uv-private/ngx-queue.h: +/home/matt/.node-gyp/0.10.24/deps/uv/include/uv-private/uv-linux.h: +/home/matt/.node-gyp/0.10.24/src/node_object_wrap.h: +/home/matt/.node-gyp/0.10.24/src/node.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/bn.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/bn/bn.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/e_os2.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../e_os2.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/opensslconf.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/opensslconf.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/../../config/opensslconf.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/ossl_typ.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/ossl_typ.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/crypto.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/crypto.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/stack.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/stack/stack.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/safestack.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/stack/safestack.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/opensslv.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/opensslv.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/symhacks.h: +/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include/openssl/../../crypto/symhacks.h: diff --git a/node_modules/bignum/build/Release/bignum.node b/node_modules/bignum/build/Release/bignum.node new file mode 100755 index 0000000..e2a454b Binary files /dev/null and b/node_modules/bignum/build/Release/bignum.node differ diff --git a/node_modules/bignum/build/Release/linker.lock b/node_modules/bignum/build/Release/linker.lock new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/bignum/build/Release/obj.target/bignum.node b/node_modules/bignum/build/Release/obj.target/bignum.node new file mode 100755 index 0000000..e2a454b Binary files /dev/null and b/node_modules/bignum/build/Release/obj.target/bignum.node differ diff --git a/node_modules/bignum/build/Release/obj.target/bignum/bignum.o b/node_modules/bignum/build/Release/obj.target/bignum/bignum.o new file mode 100644 index 0000000..51cd1fa Binary files /dev/null and b/node_modules/bignum/build/Release/obj.target/bignum/bignum.o differ diff --git a/node_modules/bignum/build/bignum.target.mk b/node_modules/bignum/build/bignum.target.mk new file mode 100644 index 0000000..40f0b0c --- /dev/null +++ b/node_modules/bignum/build/bignum.target.mk @@ -0,0 +1,134 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := bignum +DEFS_Debug := \ + '-D_LARGEFILE_SOURCE' \ + '-D_FILE_OFFSET_BITS=64' \ + '-DBUILDING_NODE_EXTENSION' \ + '-DDEBUG' \ + '-D_DEBUG' + +# Flags passed to all source files. +CFLAGS_Debug := \ + -fPIC \ + -Wall \ + -Wextra \ + -Wno-unused-parameter \ + -pthread \ + -m64 \ + -g \ + -O0 + +# Flags passed to only C files. +CFLAGS_C_Debug := + +# Flags passed to only C++ files. +CFLAGS_CC_Debug := \ + -fno-rtti \ + -fno-exceptions + +INCS_Debug := \ + -I/home/matt/.node-gyp/0.10.24/src \ + -I/home/matt/.node-gyp/0.10.24/deps/uv/include \ + -I/home/matt/.node-gyp/0.10.24/deps/v8/include \ + -I/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include \ + -I/home/matt/.node-gyp/0.10.24/deps/openssl/config/k8 + +DEFS_Release := \ + '-D_LARGEFILE_SOURCE' \ + '-D_FILE_OFFSET_BITS=64' \ + '-DBUILDING_NODE_EXTENSION' + +# Flags passed to all source files. +CFLAGS_Release := \ + -fPIC \ + -Wall \ + -Wextra \ + -Wno-unused-parameter \ + -pthread \ + -m64 \ + -O2 \ + -fno-strict-aliasing \ + -fno-tree-vrp \ + -fno-omit-frame-pointer + +# Flags passed to only C files. +CFLAGS_C_Release := + +# Flags passed to only C++ files. +CFLAGS_CC_Release := \ + -fno-rtti \ + -fno-exceptions + +INCS_Release := \ + -I/home/matt/.node-gyp/0.10.24/src \ + -I/home/matt/.node-gyp/0.10.24/deps/uv/include \ + -I/home/matt/.node-gyp/0.10.24/deps/v8/include \ + -I/home/matt/.node-gyp/0.10.24/deps/openssl/openssl/include \ + -I/home/matt/.node-gyp/0.10.24/deps/openssl/config/k8 + +OBJS := \ + $(obj).target/$(TARGET)/bignum.o + +# Add to the list of files we specially track dependencies for. +all_deps += $(OBJS) + +# CFLAGS et al overrides must be target-local. +# See "Target-specific Variable Values" in the GNU Make manual. +$(OBJS): TOOLSET := $(TOOLSET) +$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) +$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) + +# Suffix rules, putting all outputs into $(obj). + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +# Try building from generated source, too. + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +# End of this set of suffix rules +### Rules for final target. +LDFLAGS_Debug := \ + -pthread \ + -rdynamic \ + -m64 + +LDFLAGS_Release := \ + -pthread \ + -rdynamic \ + -m64 + +LIBS := + +$(obj).target/bignum.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE)) +$(obj).target/bignum.node: LIBS := $(LIBS) +$(obj).target/bignum.node: TOOLSET := $(TOOLSET) +$(obj).target/bignum.node: $(OBJS) FORCE_DO_CMD + $(call do_cmd,solink_module) + +all_deps += $(obj).target/bignum.node +# Add target alias +.PHONY: bignum +bignum: $(builddir)/bignum.node + +# Copy this to the executable output path. +$(builddir)/bignum.node: TOOLSET := $(TOOLSET) +$(builddir)/bignum.node: $(obj).target/bignum.node FORCE_DO_CMD + $(call do_cmd,copy) + +all_deps += $(builddir)/bignum.node +# Short alias for building this executable. +.PHONY: bignum.node +bignum.node: $(obj).target/bignum.node $(builddir)/bignum.node + +# Add executable to "all" target. +.PHONY: all +all: $(builddir)/bignum.node + diff --git a/node_modules/bignum/build/binding.Makefile b/node_modules/bignum/build/binding.Makefile new file mode 100644 index 0000000..6fc7f7d --- /dev/null +++ b/node_modules/bignum/build/binding.Makefile @@ -0,0 +1,6 @@ +# This file is generated by gyp; do not edit. + +export builddir_name ?= build/./. +.PHONY: all +all: + $(MAKE) bignum diff --git a/node_modules/bignum/build/config.gypi b/node_modules/bignum/build/config.gypi new file mode 100644 index 0000000..f5332b9 --- /dev/null +++ b/node_modules/bignum/build/config.gypi @@ -0,0 +1,115 @@ +# Do not edit. File was generated by node-gyp's "configure" step +{ + "target_defaults": { + "cflags": [], + "default_configuration": "Release", + "defines": [], + "include_dirs": [], + "libraries": [] + }, + "variables": { + "clang": 0, + "gcc_version": 48, + "host_arch": "x64", + "node_install_npm": "true", + "node_prefix": "/usr", + "node_shared_cares": "false", + "node_shared_http_parser": "false", + "node_shared_libuv": "false", + "node_shared_openssl": "false", + "node_shared_v8": "false", + "node_shared_zlib": "false", + "node_tag": "", + "node_unsafe_optimizations": 0, + "node_use_dtrace": "false", + "node_use_etw": "false", + "node_use_openssl": "true", + "node_use_perfctr": "false", + "node_use_systemtap": "false", + "python": "/usr/bin/python", + "target_arch": "x64", + "v8_enable_gdbjit": 0, + "v8_no_strict_aliasing": 1, + "v8_use_snapshot": "false", + "nodedir": "/home/matt/.node-gyp/0.10.24", + "copy_dev_lib": "true", + "standalone_static_library": 1, + "cache_lock_stale": "60000", + "sign_git_tag": "", + "always_auth": "", + "user_agent": "node/v0.10.24 linux x64", + "bin_links": "true", + "key": "", + "description": "true", + "fetch_retries": "2", + "heading": "npm", + "user": "", + "force": "", + "cache_min": "10", + "init_license": "ISC", + "editor": "vi", + "rollback": "true", + "cache_max": "null", + "userconfig": "/home/matt/.npmrc", + "engine_strict": "", + "init_author_name": "", + "init_author_url": "", + "tmp": "/home/matt/tmp", + "depth": "null", + "save_dev": "", + "usage": "", + "https_proxy": "", + "onload_script": "", + "rebuild_bundle": "true", + "save_bundle": "", + "shell": "/bin/bash", + "prefix": "/usr", + "registry": "https://registry.npmjs.org/", + "browser": "", + "cache_lock_wait": "10000", + "save_optional": "", + "searchopts": "", + "versions": "", + "cache": "/home/matt/.npm", + "ignore_scripts": "", + "searchsort": "name", + "version": "", + "local_address": "", + "viewer": "man", + "color": "true", + "fetch_retry_mintimeout": "10000", + "umask": "18", + "fetch_retry_maxtimeout": "60000", + "message": "%s", + "cert": "", + "global": "", + "link": "", + "save": "", + "unicode": "true", + "long": "", + "production": "", + "unsafe_perm": "true", + "node_version": "v0.10.24", + "tag": "latest", + "git_tag_version": "true", + "shrinkwrap": "true", + "fetch_retry_factor": "10", + "npat": "", + "proprietary_attribs": "true", + "strict_ssl": "true", + "username": "", + "dev": "", + "globalconfig": "/usr/etc/npmrc", + "init_module": "/home/matt/.npm-init.js", + "parseable": "", + "globalignorefile": "/usr/etc/npmignore", + "cache_lock_retries": "10", + "group": "1000", + "init_author_email": "", + "searchexclude": "", + "git": "git", + "optional": "true", + "email": "", + "json": "" + } +} diff --git a/node_modules/bignum/examples/gen.js b/node_modules/bignum/examples/gen.js new file mode 100644 index 0000000..b880c15 --- /dev/null +++ b/node_modules/bignum/examples/gen.js @@ -0,0 +1,25 @@ +// Generate two primes p and q to the Digital Signature Standard (DSS) +// http://www.itl.nist.gov/fipspubs/fip186.htm appendix 2.2 + +var bignum = require('../'); +var assert = require('assert'); + +var q = bignum(2).pow(159).add(1).rand(bignum(2).pow(160)).nextPrime(); +var L = 512 + 64 * Math.floor(Math.random() * 8); + +do { + var X = bignum(2).pow(L-1).add(1).rand(bignum(2).pow(L)); + var c = X.mod(q.mul(2)); + var p = X.sub(c.sub(1)); // p is congruent to 1 % 2q somehow! +} while (p.lt(bignum.pow(2, L - 1)) || p.probPrime(50) === false) + +assert.ok(q.gt(bignum.pow(2,159)), 'q > 2**159'); +assert.ok(q.lt(bignum.pow(2,160)), 'q < 2**160'); +assert.ok(p.gt(bignum.pow(2,L-1)), 'p > 2**(L-1)'); +assert.ok(q.lt(bignum.pow(2,L)), 'p < 2**L'); +assert.ok(q.mul(p.sub(1).div(q)).add(1).eq(p), 'q divides p - 1'); + +assert.ok(p.probPrime(50), 'p is not prime!'); +assert.ok(q.probPrime(50), 'q is not prime!'); + +console.dir({ p : p, q : q }); diff --git a/node_modules/bignum/examples/perfect.js b/node_modules/bignum/examples/perfect.js new file mode 100644 index 0000000..c8c3bcd --- /dev/null +++ b/node_modules/bignum/examples/perfect.js @@ -0,0 +1,10 @@ +// If 2**n-1 is prime, then (2**n-1) * 2**(n-1) is perfect. +var bignum = require('../'); + +for (var n = 0; n < 100; n++) { + var p = bignum.pow(2, n).sub(1); + if (p.probPrime(50)) { + var perfect = p.mul(bignum.pow(2, n - 1)); + console.log(perfect.toString()); + } +} diff --git a/node_modules/bignum/examples/simple.js b/node_modules/bignum/examples/simple.js new file mode 100644 index 0000000..9507e9a --- /dev/null +++ b/node_modules/bignum/examples/simple.js @@ -0,0 +1,7 @@ +var bignum = require('../'); + +var b = bignum('782910138827292261791972728324982') + .sub('182373273283402171237474774728373') + .div(8) +; +console.log(b); diff --git a/node_modules/bignum/index.js b/node_modules/bignum/index.js new file mode 100644 index 0000000..a17ff1a --- /dev/null +++ b/node_modules/bignum/index.js @@ -0,0 +1,433 @@ +try { + var cc = new require('./build/Debug/bignum'); +} catch(e) { + var cc = new require('./build/Release/bignum'); +} +var BigNum = cc.BigNum; + +module.exports = BigNum; + +BigNum.conditionArgs = function(num, base) { + if (typeof num !== 'string') num = num.toString(base || 10); + + if (num.match(/e\+/)) { // positive exponent + if (!Number(num).toString().match(/e\+/)) { + return { + num: Math.floor(Number(num)).toString(), + base: 10 + }; + } + else { + var pow = Math.ceil(Math.log(num) / Math.log(2)); + var n = (num / Math.pow(2, pow)).toString(2) + .replace(/^0/,''); + var i = n.length - n.indexOf('.'); + n = n.replace(/\./,''); + + for (; i <= pow; i++) n += '0'; + return { + num : n, + base : 2, + }; + } + } + else if (num.match(/e\-/)) { // negative exponent + return { + num : Math.floor(Number(num)).toString(), + base : base || 10 + }; + } + else { + return { + num : num, + base : base || 10, + }; + } +}; + +cc.setJSConditioner(BigNum.conditionArgs); + +BigNum.prototype.inspect = function () { + return ''; +}; + +BigNum.prototype.toString = function (base) { + var value; + if (base) { + value = this.tostring(base); + } else { + value = this.tostring(); + } + if (base > 10 && "string" === typeof value) { + value = value.toLowerCase(); + } + return value; +}; + +BigNum.prototype.toNumber = function () { + return parseInt(this.toString(), 10); +}; + +[ 'add', 'sub', 'mul', 'div', 'mod' ].forEach(function (op) { + BigNum.prototype[op] = function (num) { + if (num instanceof BigNum) { + return this['b'+op](num); + } + else if (typeof num === 'number') { + if (num >= 0) { + return this['u'+op](num); + } + else if (op === 'add') { + return this.usub(-num); + } + else if (op === 'sub') { + return this.uadd(-num); + } + else { + var x = BigNum(num); + return this['b'+op](x); + } + } + else if (typeof num === 'string') { + var x = BigNum(num); + return this['b'+op](x); + } + else { + throw new TypeError('Unspecified operation for type ' + + (typeof num) + ' for ' + op); + } + }; +}); + +BigNum.prototype.abs = function () { + return this.babs(); +}; + +BigNum.prototype.neg = function () { + return this.bneg(); +}; + +BigNum.prototype.powm = function (num, mod) { + var m, res; + + if ((typeof mod) === 'number' || (typeof mod) === 'string') { + m = BigNum(mod); + } + else if (mod instanceof BigNum) { + m = mod; + } + + if ((typeof num) === 'number') { + return this.upowm(num, m); + } + else if ((typeof num) === 'string') { + var n = BigNum(num); + return this.bpowm(n, m); + } + else if (num instanceof BigNum) { + return this.bpowm(num, m); + } +}; + +BigNum.prototype.mod = function (num, mod) { + var m, res; + + if ((typeof mod) === 'number' || (typeof mod) === 'string') { + m = BigNum(mod); + } + else if (mod instanceof BigNum) { + m = mod; + } + + if ((typeof num) === 'number') { + return this.umod(num, m); + } + else if ((typeof num) === 'string') { + var n = BigNum(num); + return this.bmod(n, m); + } + else if (num instanceof BigNum) { + return this.bmod(num, m); + } +}; + + +BigNum.prototype.pow = function (num) { + if (typeof num === 'number') { + if (num >= 0) { + return this.upow(num); + } + else { + return BigNum.prototype.powm.call(this, num, this); + } + } + else { + var x = parseInt(num.toString(), 10); + return BigNum.prototype.pow.call(this, x); + } +}; + +BigNum.prototype.shiftLeft = function (num) { + if (typeof num === 'number') { + if (num >= 0) { + return this.umul2exp(num); + } + else { + return this.shiftRight(-num); + } + } + else { + var x = parseInt(num.toString(), 10); + return BigNum.prototype.shiftLeft.call(this, x); + } +}; + +BigNum.prototype.shiftRight = function (num) { + if (typeof num === 'number') { + if (num >= 0) { + return this.udiv2exp(num); + } + else { + return this.shiftLeft(-num); + } + } + else { + var x = parseInt(num.toString(), 10); + return BigNum.prototype.shiftRight.call(this, x); + } +}; + +BigNum.prototype.cmp = function (num) { + if (num instanceof BigNum) { + return this.bcompare(num); + } + else if (typeof num === 'number') { + if (num < 0) { + return this.scompare(num); + } + else { + return this.ucompare(num); + } + } + else { + var x = BigNum(num); + return this.bcompare(x); + } +}; + +BigNum.prototype.gt = function (num) { + return this.cmp(num) > 0; +}; + +BigNum.prototype.ge = function (num) { + return this.cmp(num) >= 0; +}; + +BigNum.prototype.eq = function (num) { + return this.cmp(num) === 0; +}; + +BigNum.prototype.ne = function (num) { + return this.cmp(num) !== 0; +}; + +BigNum.prototype.lt = function (num) { + return this.cmp(num) < 0; +}; + +BigNum.prototype.le = function (num) { + return this.cmp(num) <= 0; +}; + +'and or xor'.split(' ').forEach(function (name) { + BigNum.prototype[name] = function (num) { + if (num instanceof BigNum) { + return this['b' + name](num); + } + else { + var x = BigNum(num); + return this['b' + name](x); + } + }; +}); + +BigNum.prototype.sqrt = function() { + return this.bsqrt(); +}; + +BigNum.prototype.root = function(num) { + if (num instanceof BigNum) { + return this.broot(num); + } + else { + var x = BigNum(num); + return this.broot(num); + } +}; + +BigNum.prototype.rand = function (to) { + if (to === undefined) { + if (this.toString() === '1') { + return BigNum(0); + } + else { + return this.brand0(); + } + } + else { + var x = to instanceof BigNum + ? to.sub(this) + : BigNum(to).sub(this); + return x.brand0().add(this); + } +}; + +BigNum.prototype.invertm = function (mod) { + if (mod instanceof BigNum) { + return this.binvertm(mod); + } + else { + var x = BigNum(mod); + return this.binvertm(x); + } +}; + +BigNum.prime = function (bits, safe) { + if ("undefined" === typeof safe) { + safe = true; + } + + // Force uint32 + bits >>>= 0; + + return BigNum.uprime0(bits, !!safe); +}; + +BigNum.prototype.probPrime = function (reps) { + var n = this.probprime(reps || 10); + return { 1 : true, 0 : false }[n]; +}; + +BigNum.prototype.nextPrime = function () { + var num = this; + do { + num = num.add(1); + } while (!num.probPrime()); + return num; +}; + +BigNum.fromBuffer = function (buf, opts) { + if (!opts) opts = {}; + + var endian = { 1 : 'big', '-1' : 'little' }[opts.endian] + || opts.endian || 'big' + ; + + var size = opts.size === 'auto' ? Math.ceil(buf.length) : (opts.size || 1); + + if (buf.length % size !== 0) { + throw new RangeError('Buffer length (' + buf.length + ')' + + ' must be a multiple of size (' + size + ')' + ); + } + + var hex = []; + for (var i = 0; i < buf.length; i += size) { + var chunk = []; + for (var j = 0; j < size; j++) { + chunk.push(buf[ + i + (endian === 'big' ? j : (size - j - 1)) + ]); + } + + hex.push(chunk + .map(function (c) { + return (c < 16 ? '0' : '') + c.toString(16); + }) + .join('') + ); + } + + return BigNum(hex.join(''), 16); +}; + +BigNum.prototype.toBuffer = function (opts) { + if (typeof opts === 'string') { + if (opts !== 'mpint') return 'Unsupported Buffer representation'; + + var abs = this.abs(); + var buf = abs.toBuffer({ size : 1, endian : 'big' }); + var len = buf.length === 1 && buf[0] === 0 ? 0 : buf.length; + if (buf[0] & 0x80) len ++; + + var ret = new Buffer(4 + len); + if (len > 0) buf.copy(ret, 4 + (buf[0] & 0x80 ? 1 : 0)); + if (buf[0] & 0x80) ret[4] = 0; + + ret[0] = len & (0xff << 24); + ret[1] = len & (0xff << 16); + ret[2] = len & (0xff << 8); + ret[3] = len & (0xff << 0); + + // two's compliment for negative integers: + var isNeg = this.lt(0); + if (isNeg) { + for (var i = 4; i < ret.length; i++) { + ret[i] = 0xff - ret[i]; + } + } + ret[4] = (ret[4] & 0x7f) | (isNeg ? 0x80 : 0); + if (isNeg) ret[ret.length - 1] ++; + + return ret; + } + + if (!opts) opts = {}; + + var endian = { 1 : 'big', '-1' : 'little' }[opts.endian] + || opts.endian || 'big' + ; + + var hex = this.toString(16); + if (hex.charAt(0) === '-') throw new Error( + 'converting negative numbers to Buffers not supported yet' + ); + + var size = opts.size === 'auto' ? Math.ceil(hex.length / 2) : (opts.size || 1); + + var len = Math.ceil(hex.length / (2 * size)) * size; + var buf = new Buffer(len); + + // zero-pad the hex string so the chunks are all `size` long + while (hex.length < 2 * len) hex = '0' + hex; + + var hx = hex + .split(new RegExp('(.{' + (2 * size) + '})')) + .filter(function (s) { return s.length > 0 }) + ; + + hx.forEach(function (chunk, i) { + for (var j = 0; j < size; j++) { + var ix = i * size + (endian === 'big' ? j : size - j - 1); + buf[ix] = parseInt(chunk.slice(j*2,j*2+2), 16); + } + }); + + return buf; +}; + +Object.keys(BigNum.prototype).forEach(function (name) { + if (name === 'inspect' || name === 'toString') return; + + BigNum[name] = function (num) { + var args = [].slice.call(arguments, 1); + + if (num instanceof BigNum) { + return num[name].apply(num, args); + } + else { + var bigi = BigNum(num); + return bigi[name].apply(bigi, args); + } + }; +}); diff --git a/node_modules/bignum/package.json b/node_modules/bignum/package.json new file mode 100644 index 0000000..98a10f2 --- /dev/null +++ b/node_modules/bignum/package.json @@ -0,0 +1,51 @@ +{ + "name": "bignum", + "version": "0.6.2", + "description": "Arbitrary-precision integer arithmetic using OpenSSL", + "main": "./index.js", + "repository": { + "type": "git", + "url": "http://github.com/justmoon/node-bignum.git" + }, + "keywords": [ + "openssl", + "big", + "bignum", + "bigint", + "integer", + "arithmetic", + "precision" + ], + "author": { + "name": "Stefan Thomas", + "email": "justmoon@members.fsf.org", + "url": "http://www.justmoon.net" + }, + "devDependencies": { + "expresso": ">=0.6.0", + "binary": ">=0.1.7", + "put": ">=0.0.5" + }, + "license": "MIT/X11", + "engine": { + "node": ">=0.8.0" + }, + "scripts": { + "install": "node-gyp configure build", + "test": "expresso" + }, + "contributors": [ + { + "name": "James Halliday", + "email": "mail@substack.net" + } + ], + "readme": "bignum\n======\n\nArbitrary precision integral arithmetic for Node.js using\nOpenSSL.\n\nThis library is based on\n[node-bigint](https://github.com/substack/node-bigint) by\n[substack](https://github.com/substack), but instead of using libgmp,\nit uses the builtin bignum functionality provided by OpenSSL. The\nadvantage is that OpenSSL is already part of Node.js, so this\nlibrary does not add any external dependency whatsoever.\n\ndifferences\n===========\n\nWhen switching from node-bigint to node-bignum, please be aware of\nthese differences:\n\n- Bignum rounds towards zero for integer divisions, e.g. `10 / -3 = -3`, whereas bigint\n rounds towards negative infinity, e.g. `10 / -3 = -4`.\n- Bitwise operations (and, or, xor) are implemented for positive numbers only.\n- nextPrime() is not supported.\n- sqrt() and root() are not supported.\n\n(Patches for the missing functionality are welcome.)\n\nexample\n=======\n\nsimple.js\n---------\n\n var bignum = require('bignum');\n\n var b = bignum('782910138827292261791972728324982')\n .sub('182373273283402171237474774728373')\n .div(8)\n ;\n console.log(b);\n\n***\n $ node simple.js\n \n\nperfect.js\n----------\n\nGenerate the perfect numbers:\n\n // If 2**n-1 is prime, then (2**n-1) * 2**(n-1) is perfect.\n var bignum = require('bignum');\n\n for (var n = 0; n < 100; n++) {\n var p = bignum.pow(2, n).sub(1);\n if (p.probPrime(50)) {\n var perfect = p.mul(bignum.pow(2, n - 1));\n console.log(perfect.toString());\n }\n }\n\n***\n\n 6\n 28\n 496\n 8128\n 33550336\n 8589869056\n 137438691328\n 2305843008139952128\n 2658455991569831744654692615953842176\n 191561942608236107294793378084303638130997321548169216\n\nmethods[0]\n==========\n\nbignum(n, base=10)\n------------------\n\nCreate a new `bignum` from `n` and a base. `n` can be a string, integer, or\nanother `bignum`.\n\nIf you pass in a string you can set the base that string is encoded in.\n\n.toString(base=10)\n------------------\n\nPrint out the `bignum` instance in the requested base as a string.\n\nbignum.fromBuffer(buf, opts)\n----------------------------\n\nCreate a new `bignum` from a `Buffer`.\n\nThe default options are:\n\n {\n endian : 'big',\n size : 1, // number of bytes in each word\n }\n\nNote that endian doesn't matter when size = 1. If you wish to reverse the entire buffer byte by byte, pass size: 'auto'.\n\nbignum.prime(bits, safe=true)\n-----------------------------\n\nGenerate a probable prime of length `bits`. If `safe` is true, it will be a \"safe\" prime of the form p=2p'+1 where p' is also prime.\n\nmethods[1]\n==========\n\nFor all of the instance methods below you can write either\n\n bignum.method(x, y, z)\n\nor if x is a `bignum` instance``\n\n x.method(y, z)\n\n.toNumber()\n-----------\n\nTurn a `bignum` into a `Number`. If the `bignum` is too big you'll lose\nprecision or you'll get ±`Infinity`.\n\n.toBuffer(opts)\n-------------\n\nReturn a new `Buffer` with the data from the `bignum`.\n\nThe default options are:\n\n {\n endian : 'big',\n size : 1, // number of bytes in each word\n }\n\nNote that endian doesn't matter when size = 1. If you wish to reverse the entire buffer byte by byte, pass size: 'auto'.\n\n.add(n)\n-------\n\nReturn a new `bignum` containing the instance value plus `n`.\n\n.sub(n)\n-------\n\nReturn a new `bignum` containing the instance value minus `n`.\n\n.mul(n)\n-------\n\nReturn a new `bignum` containing the instance value multiplied by `n`.\n\n.div(n)\n-------\n\nReturn a new `bignum` containing the instance value integrally divided by `n`.\n\n.abs()\n------\n\nReturn a new `bignum` with the absolute value of the instance.\n\n.neg()\n------\n\nReturn a new `bignum` with the negative of the instance value.\n\n.cmp(n)\n-------\n\nCompare the instance value to `n`. Return a positive integer if `> n`, a\nnegative integer if `< n`, and 0 if `== n`.\n\n.gt(n)\n------\n\nReturn a boolean: whether the instance value is greater than n (`> n`).\n\n.ge(n)\n------\n\nReturn a boolean: whether the instance value is greater than or equal to n\n(`>= n`).\n\n.eq(n)\n------\n\nReturn a boolean: whether the instance value is equal to n (`== n`).\n\n.lt(n)\n------\n\nReturn a boolean: whether the instance value is less than n (`< n`).\n\n.le(n)\n------\n\nReturn a boolean: whether the instance value is less than or equal to n\n(`<= n`).\n\n.and(n)\n-------\n\nReturn a new `bignum` with the instance value bitwise AND (&)-ed with `n`.\n\n.or(n)\n------\n\nReturn a new `bignum` with the instance value bitwise inclusive-OR (|)-ed with\n`n`.\n\n.xor(n)\n-------\n\nReturn a new `bignum` with the instance value bitwise exclusive-OR (^)-ed with\n`n`.\n\n.mod(n)\n-------\n\nReturn a new `bignum` with the instance value modulo `n`.\n\n`m`.\n.pow(n)\n-------\n\nReturn a new `bignum` with the instance value raised to the `n`th power.\n\n.powm(n, m)\n-----------\n\nReturn a new `bignum` with the instance value raised to the `n`th power modulo\n`m`.\n\n.invertm(m)\n-----------\n\nCompute the multiplicative inverse modulo `m`.\n\n.rand()\n-------\n.rand(upperBound)\n-----------------\n\nIf `upperBound` is supplied, return a random `bignum` between the instance value\nand `upperBound - 1`, inclusive.\n\nOtherwise, return a random `bignum` between 0 and the instance value - 1,\ninclusive.\n\n.probPrime()\n------------\n\nReturn whether the bignum is:\n\n* certainly prime (true)\n* probably prime ('maybe')\n* certainly composite (false)\n\nusing [BN_is_prime_ex](http://www.openssl.org/docs/crypto/BN_generate_prime.html).\n\n.sqrt()\n-------\n\nReturn a new `bignum` that is the square root. This truncates.\n\n.root(n)\n-------\n\nReturn a new `bignum` that is the `nth` root. This truncates.\n\n.shiftLeft(n)\n-------------\n\nReturn a new `bignum` that is the `2^n` multiple. Equivalent of the `<<`\noperator.\n\n.shiftRight(n)\n--------------\n\nReturn a new `bignum` of the value integer divided by\n`2^n`. Equivalent of the `>>` operator.\n\n.gcd(n)\n-------\n\nReturn the greatest common divisor of the current `bignum` with `n` as a new\n`bignum`.\n\n.jacobi(n)\n-------\n\nReturn the Jacobi symbol (or Legendre symbol if `n` is prime) of the current\n`bignum` (= a) over `n`. Note that `n` must be odd and >= 3. 0 <= a < n.\n\nReturns -1 or 1 as an int (NOT a bignum). Throws an error on failure.\n\n.bitLength()\n------------\n\nReturn the number of bits used to represent the current `bignum`.\n\ninstall\n=======\n\nTo compile the package, your system needs to be set up for building Node.js\nmodules.\n\nYou can install node-bignum with [npm](http://npmjs.org):\n\n npm install bignum\n\ndevelop\n=======\n\nYou can clone the git repo and compile with\n\n git clone git://github.com/justmoon/node-bignum.git\n cd node-bignum\n npm install\n\nRun the tests with\n\n npm test\n", + "readmeFilename": "README.markdown", + "bugs": { + "url": "https://github.com/justmoon/node-bignum/issues" + }, + "homepage": "https://github.com/justmoon/node-bignum", + "_id": "bignum@0.6.2", + "_from": "bignum@" +} diff --git a/node_modules/bignum/test/big.js b/node_modules/bignum/test/big.js new file mode 100644 index 0000000..4c44caa --- /dev/null +++ b/node_modules/bignum/test/big.js @@ -0,0 +1,495 @@ +var assert = require('assert'); +var bignum = require('../'); + +exports.create = function () { + assert.eql(bignum(1337).toString(), '1337'); + assert.eql(bignum('1337').toString(), '1337'); + assert.eql(new bignum('100').toString(), '100'); + assert.eql( + new bignum('55555555555555555555555555').toString(), + '55555555555555555555555555' + ); + + assert.eql(Number(bignum('1e+100').toString()), 1e+100); + assert.eql(bignum('1e+100').bitLength(), 333); + assert.eql(Number(bignum('1.23e+45').toString()), 1.23e+45); + for (var i = 0; i < 10; i++) { + assert.eql( + bignum('1.23456e+' + i).toString(), + Math.floor(1.23456 * Math.pow(10,i)) + ); + } + + assert.eql(bignum('1.23e-45').toString(), '0'); + + assert.throws(function() { bignum(undefined); }); + assert.throws(function() { bignum(null); }); +}; + +exports.add = function () { + for (var i = -10; i < 10; i++) { + for (var j = -10; j < 10; j++) { + var is = i.toString(); + var js = j.toString(); + var ks = (i + j).toString(); + assert.eql(bignum(i).add(j).toString(), ks); + assert.eql(bignum(i).add(js).toString(), ks); + assert.eql(bignum(i).add(bignum(j)).toString(), ks); + assert.eql(bignum.add(i, j).toString(), ks); + } + } + + assert.eql( + bignum( + '201781752444966478956292456789265633588628356858680927185287861892' + + '9889675589272409635031813235465496971529430565627918846694860512' + + '1492948268400884893722767401972695174353441' + ).add( + '939769862972759638577945343130228368606420083646071622223953046277' + + '3784500359975110887672142614667937014937371109558223563373329424' + + '0624814097369771481147215472578762824607080' + ).toString(), + '1141551615417726117534237799919494002195048440504752549409240908170367' + + '41759492475205227039558501334339864668016751861424100681899362117762' + + '365770656374869982874551457998960521' + ); +}; + +exports.sub = function () { + for (var i = -10; i < 10; i++) { + for (var j = -10; j < 10; j++) { + var is = i.toString(); + var js = j.toString(); + var ks = (i - j).toString(); + assert.eql(bignum(i).sub(j).toString(), ks); + assert.eql(bignum(i).sub(js).toString(), ks); + assert.eql(bignum(i).sub(bignum(j)).toString(), ks); + assert.eql(bignum.sub(i, j).toString(), ks); + } + } + + assert.eql( + bignum( + '635849762218952604062459342660379446997761295162166888134051068531' + + '9813941775949841573516110003093332652267534768664621969514455380' + + '8051168706779408804756208386011014197185296' + ).sub( + '757617343536280696839135295661092954931163607913400460585109207644' + + '7966483882748233585856350085641718822741649072106343655764769889' + + '6399869016678013515043471880323279258685478' + ).toString(), + '-121767581317328092776675953000713507933402312751233572451058139112815' + + '25421067983920123402400825483861704741143034417216862503145088348700' + + '309898604710287263494312265061500182' + ); +}; + +exports.mul = function () { + for (var i = -10; i < 10; i++) { + for (var j = -10; j < 10; j++) { + var is = i.toString(); + var js = j.toString(); + var ks = (i * j).toString(); + assert.eql(bignum(i).mul(j).toString(), ks); + assert.eql(bignum(i).mul(js).toString(), ks); + assert.eql(bignum(i).mul(bignum(j)).toString(), ks); + assert.eql(bignum.mul(i, j).toString(), ks); + } + } + + assert.eql( + bignum( + '433593290010590489671135819286259593426549306666324008679782084292' + + '2446494189019075159822930571858728009485237489829138626896756141' + + '8738958337632249177044975686477011571044266' + ).mul( + '127790264841901718791915669264129510947625523373763053776083279450' + + '3886212911067061184379695097643279217271150419129022856601771338' + + '794256383410400076210073482253089544155377' + ).toString(), + '5540900136412485758752141142221047463857522755277604708501015732755989' + + '17659432099233635577634197309727815375309484297883528869192732141328' + + '99346769031695550850320602049507618052164677667378189154076988316301' + + '23719953859959804490669091769150047414629675184805332001182298088891' + + '58079529848220802017396422115936618644438110463469902675126288489182' + + '82' + ); + + assert.eql( + bignum('10000000000000000000000000000').mul(-123).toString(), + '-1230000000000000000000000000000' + ); +}; + +exports.div = function () { + for (var i = -10; i < 10; i++) { + for (var j = -10; j < 10; j++) { + var is = i.toString(); + var js = j.toString(); + var round = ((i/j) < 0) ? Math.ceil : Math.floor; + var ks = round(i / j).toString(); + if (ks.match(/^-?\d+$/)) { // ignore exceptions + assert.eql(bignum(i).div(j).toString(), ks); + assert.eql(bignum(i).div(js).toString(), ks); + assert.eql(bignum(i).div(bignum(j)).toString(), ks); + assert.eql(bignum.div(i, j).toString(), ks); + } + } + } + + assert.eql( + bignum( + '433593290010590489671135819286259593426549306666324008679782084292' + + '2446494189019075159822930571858728009485237489829138626896756141' + + '8738958337632249177044975686477011571044266' + ).div( + '127790264841901718791915669264129510947625523373763053776083279450' + + '3886212911067061184379695097643279217271150419129022856601771338' + + '794256383410400076210073482253089544155377' + ).toString(), + '33' + ); +}; + +exports.abs = function () { + assert.eql( + bignum( + '433593290010590489671135819286259593426549306666324008679782084292' + + '2446494189019075159822930571858728009485237489829138626896756141' + + '8738958337632249177044975686477011571044266' + ).abs().toString(), + '4335932900105904896711358192862595934265493066663240086797820842922446' + + '49418901907515982293057185872800948523748982913862689675614187389583' + + '37632249177044975686477011571044266' + ); + + assert.eql( + bignum( + '-43359329001059048967113581928625959342654930666632400867978208429' + + '2244649418901907515982293057185872800948523748982913862689675614' + + '18738958337632249177044975686477011571044266' + ).abs().toString(), + '4335932900105904896711358192862595934265493066663240086797820842922446' + + '49418901907515982293057185872800948523748982913862689675614187389583' + + '37632249177044975686477011571044266' + ); +}; + +exports.neg = function () { + assert.eql( + bignum( + '433593290010590489671135819286259593426549306666324008679782084292' + + '2446494189019075159822930571858728009485237489829138626896756141' + + '8738958337632249177044975686477011571044266' + ).neg().toString(), + '-433593290010590489671135819286259593426549306666324008679782084292244' + + '64941890190751598229305718587280094852374898291386268967561418738958' + + '337632249177044975686477011571044266' + ); + + assert.eql( + bignum( + '-43359329001059048967113581928625959342654930666632400867978208429' + + '2244649418901907515982293057185872800948523748982913862689675614' + + '18738958337632249177044975686477011571044266' + ).neg().toString(), + '4335932900105904896711358192862595934265493066663240086797820842922446' + + '49418901907515982293057185872800948523748982913862689675614187389583' + + '37632249177044975686477011571044266' + ); +}; + +exports.mod = function () { + for (var i = 0; i < 10; i++) { + for (var j = 0; j < 10; j++) { + var is = i.toString(); + var js = j.toString(); + if (!isNaN(i % j)) { + var ks = (i % j).toString(); + assert.eql(bignum(i).mod(j).toString(), ks); + assert.eql(bignum(i).mod(js).toString(), ks); + assert.eql(bignum(i).mod(bignum(j)).toString(), ks); + assert.eql(bignum.mod(i, j).toString(), ks); + } + } + } + + assert.eql( + bignum('486541542410442549118519277483401413') + .mod('1802185856709793916115771381388554') + .toString() + , + '1753546955507985683376775889880387' + ); +}; + +exports.cmp = function () { + for (var i = -10; i <= 10; i++) { + var bi = bignum(i); + + for (var j = -10; j <= 10; j++) { + [ j, bignum(j) ].forEach(function (jj) { + assert.eql(bi.lt(jj), i < j); + assert.eql(bi.le(jj), i <= j); + assert.eql(bi.eq(jj), i === j); + assert.eql(bi.ne(jj), i !== j); + assert.eql(bi.gt(jj), i > j); + assert.eql(bi.ge(jj), i >= j); + }); + } + } +}; + +exports.powm = function () { + var twos = [ 2, '2', bignum(2), bignum('2') ] + var tens = [ 100000, '100000', bignum(100000), bignum(100000) ]; + twos.forEach(function (two) { + tens.forEach(function (t) { + assert.eql( + bignum('111111111').powm(two, t).toString(), + '54321' + ); + }); + }); + + assert.eql( + bignum('624387628734576238746587435') + .powm(2732, '457676874367586') + .toString() + , + '335581885073251' + ); +}; + +exports.pow = function () { + [ 2, '2', bignum(2), bignum('2') ].forEach(function (two) { + assert.eql( + bignum('111111111').pow(two).toString(), + '12345678987654321' + ); + }); + + assert.eql( + bignum('3487438743234789234879').pow(22).toString(), + '861281136448465709000943928980299119292959327175552412961995332536782980636409994680542395362634321718164701236369695670918217801815161694902810780084448291245512671429670376051205638247649202527956041058237646154753587769450973231275642223337064356190945030999709422512682440247294915605076918925272414789710234097768366414400280590151549041536921814066973515842848197905763447515344747881160891303219471850554054186959791307149715821010152303317328860351766337716947079041' + ); +}; + +exports.and = function () { + for (var i = 0; i < 256; i += 7) { + for (var j = 0; j < 256; j += 7) { + var is = i.toString(); + var js = j.toString(); + var ks = (i & j).toString(); + assert.eql(bignum(i).and(j).toString(), ks); + assert.eql(bignum(i).and(js).toString(), ks); + assert.eql(bignum(i).and(bignum(j)).toString(), ks); + assert.eql(bignum.and(i, j).toString(), ks); + } + } + assert.eql(bignum.and(bignum('111111', 16), bignum('111111', 16)).toString(16), '111111'); + assert.eql(bignum.and(bignum('111110', 16), bignum('111111', 16)).toString(16), '111110'); + assert.eql(bignum.and(bignum('111112', 16), bignum('111111', 16)).toString(16), '111110'); + assert.eql(bignum.and(bignum('111121', 16), bignum('111111', 16)).toString(16), '111101'); + assert.eql(bignum.and(bignum('111131', 16), bignum('111111', 16)).toString(16), '111111'); +}; + +exports.or = function () { + for (var i = 0; i < 256; i += 7) { + for (var j = 0; j < 256; j += 7) { + var is = i.toString(); + var js = j.toString(); + var ks = (i | j).toString(); + assert.eql(bignum(i).or(j).toString(), ks); + assert.eql(bignum(i).or(js).toString(), ks); + assert.eql(bignum(i).or(bignum(j)).toString(), ks); + assert.eql(bignum.or(i, j).toString(), ks); + } + } + assert.eql(bignum.or(bignum('111111', 16), bignum('111111', 16)).toString(16), '111111'); + assert.eql(bignum.or(bignum('111110', 16), bignum('111111', 16)).toString(16), '111111'); + assert.eql(bignum.or(bignum('111112', 16), bignum('111111', 16)).toString(16), '111113'); + assert.eql(bignum.or(bignum('111121', 16), bignum('111111', 16)).toString(16), '111131'); +}; + +exports.xor = function () { + for (var i = 0; i < 256; i += 7) { + for (var j = 0; j < 256; j += 7) { + var is = i.toString(); + var js = j.toString(); + var ks = (i ^ j).toString(); + assert.eql(bignum(i).xor(j).toString(), ks); + assert.eql(bignum(i).xor(js).toString(), ks); + assert.eql(bignum(i).xor(bignum(j)).toString(), ks); + assert.eql(bignum.xor(i, j).toString(), ks); + } + } + assert.eql(bignum.xor(bignum('111111', 16), bignum('111111', 16)).toString(), 0); + assert.eql(bignum.xor(bignum('111110', 16), bignum('111111', 16)).toString(), 1); + assert.eql(bignum.xor(bignum('111112', 16), bignum('111111', 16)).toString(), 3); + assert.eql(bignum.xor(bignum('111121', 16), bignum('111111', 16)).toString(), 0x30); +}; + +exports.rand = function () { + for (var i = 1; i < 1000; i++) { + var x = bignum(i).rand().toNumber(); + assert.ok(0 <= x && x < i); + + var y = bignum(i).rand(i + 10).toNumber(); + assert.ok(i <= y && y < i + 10); + + var z = bignum.rand(i, i + 10).toNumber(); + assert.ok(i <= z && z < i + 10); + } +}; + +exports.primes = function () { + var ps = { 2 : true, 3 : true, 5 : true, 7 : true }; + for (var i = 0; i <= 10; i++) { + assert.eql(bignum(i).probPrime(), ps[i] ? true : false); + } + + var ns = { + 2 : 3, + 3 : 5, + 15313 : 15319, + 222919 : 222931, + 611939 : 611951, + 334214459 : '334214467', + 961748927 : '961748941', + 9987704933 : '9987704953', + }; + + Object.keys(ns).forEach(function (n) { + assert.eql( + bignum(n).nextPrime().toString(), + ns[n].toString() + ); + }); + + var uniques = [ + '3', '11', '37', '101', '9091', '9901', '333667', '909091', '99990001', + '999999000001', '9999999900000001', '909090909090909091', + '1111111111111111111', '11111111111111111111111', + '900900900900990990990991', + ]; + + var wagstaff = [ + '3', '11', '43', '683', '2731', '43691', '174763', '2796203', + '715827883', '2932031007403', '768614336404564651', + '201487636602438195784363', '845100400152152934331135470251', + '56713727820156410577229101238628035243', + ]; + + var big = [ + '4669523849932130508876392554713407521319117239637943224980015676156491', + '54875133386847519273109693154204970395475080920935355580245252923343305939004903', + '204005728266090048777253207241416669051476369216501266754813821619984472224780876488344279', + '2074722246773485207821695222107608587480996474721117292752992589912196684750549658310084416732550077', + '5628290459057877291809182450381238927697314822133923421169378062922140081498734424133112032854812293', + ]; + + [ uniques, wagstaff, big ].forEach(function (xs) { + xs.forEach(function (x) { + var p = bignum(x).probPrime(); + assert.ok(p === true || p === 'maybe'); + }); + }); +}; + +exports.invertm = function () { + // numbers from http://www.itl.nist.gov/fipspubs/fip186.htm appendix 5 + var q = bignum('b20db0b101df0c6624fc1392ba55f77d577481e5', 16); + var k = bignum('79577ddcaafddc038b865b19f8eb1ada8a2838c6', 16); + var kinv = k.invertm(q); + assert.eql(kinv.toString(16), '2784e3d672d972a74e22c67f4f4f726ecc751efa'); +}; + +exports.shift = function () { + assert.eql(bignum(37).shiftLeft(2).toString(), (37 << 2).toString()); // 148 + assert.eql(bignum(37).shiftRight(2).toString(), (37 >> 2).toString()); // 9 + + assert.equal( + bignum(2).pow(Math.pow(2,10)).shiftRight(4).toString(), + bignum(2).pow(Math.pow(2,10)).div(16).toString() + ); +}; + +exports.mod = function () { + assert.eql(bignum(55555).mod(2).toString(), '1'); + assert.eql( + bignum('1234567').mod( + bignum('4321') + ).toNumber(), + 1234567 % 4321 + ); +}; + +exports.endian = function () { + var a = bignum(0x0102030405); + assert.eql(a.toBuffer({ endian: 'big', size: 2 }).toString('hex'), '000102030405'); + assert.eql(a.toBuffer({ endian: 'little', size: 2 }).toString('hex'), '010003020504'); + + var b = bignum(0x0102030405); + assert.eql(a.toBuffer({ endian: 'big', size: 'auto' }).toString('hex'), '0102030405'); + assert.eql(a.toBuffer({ endian: 'little', size: 'auto' }).toString('hex'), '0504030201'); + + var c = new Buffer("000102030405", 'hex'); + assert.eql(bignum.fromBuffer(c, { endian: 'big', size: 'auto'}).toString(16), "0102030405"); + assert.eql(bignum.fromBuffer(c, { endian: 'little', size: 'auto'}).toString(16), "050403020100"); +}; + +exports.bitlength = function () { + var bl = bignum( + '433593290010590489671135819286259593426549306666324008679782084292' + + '2446494189019075159822930571858728009485237489829138626896756141' + + '873895833763224917704497568647701157104426' + ).bitLength(); + + assert.equal(bl > 0, true); +}; + +exports.gcd = function () { + var b1 = bignum('234897235923342343242'); + var b2 = bignum('234790237101762305340234'); + var expected = bignum('6'); + assert.equal(b1.gcd(b2).toString(), expected.toString()); +}; + +exports.jacobi = function () { + // test case from p. 134 of D. R. Stinson + var b1 = bignum('7411'); + var b2 = bignum('9283'); + assert.equal(b1.jacobi(b2), -1); + + // test case from p. 132 of D. R. Stinson + b1 = bignum('6278'); + b2 = bignum('9975'); + assert.equal(b1.jacobi(b2), -1); + + // test case from p. 74 of Men. Oorsh. Vans. + b1 = bignum('158'); + b2 = bignum('235'); + assert.equal(b1.jacobi(b2), -1); + + // test case from p. 216 of Kumanduri Romero + b1 = bignum('4'); + b2 = bignum('7'); + assert.equal(b1.jacobi(b2), 1); + + // test case from p. 363 of K. R. Rosen + b1 = bignum('68'); + b2 = bignum('111'); + assert.equal(b1.jacobi(b2), 1); +}; + +if (process.argv[1] === __filename) { + assert.eql = assert.deepEqual; + Object.keys(exports).forEach(function (ex) { + exports[ex](); + }); + + if ("function" === typeof gc) { + gc(); + } +} diff --git a/node_modules/bignum/test/buf.js b/node_modules/bignum/test/buf.js new file mode 100644 index 0000000..819a73b --- /dev/null +++ b/node_modules/bignum/test/buf.js @@ -0,0 +1,196 @@ +var assert = require('assert'); +var bignum = require('../'); +var put = require('put'); + +exports.buf_be = function () { + var buf1 = new Buffer([1,2,3,4]); + var num = bignum.fromBuffer(buf1, { size : 4 }).toNumber(); + assert.eql( + num, + 1*Math.pow(256, 3) + + 2 * Math.pow(256, 2) + + 3 * 256 + + 4 + ); + + var buf2 = put().word32be(num).buffer(); + assert.eql(buf1, buf2, + '[ ' + [].slice.call(buf1) + ' ] != [ ' + [].slice.call(buf2) + ' ]' + ); +}; + +exports.buf_le = function () { + var buf1 = new Buffer([1,2,3,4]); + var num = bignum + .fromBuffer(buf1, { size : 4, endian : 'little' }) + .toNumber() + ; + var buf2 = put().word32le(num).buffer(); + assert.eql(buf1, buf2, + '[ ' + [].join.call(buf1, ',') + + ' ] != [ ' + + [].join.call(buf2, ',') + ' ]' + ); +}; + +exports.buf_be_le = function () { + var buf_be = new Buffer([1,2,3,4,5,6,7,8]); + var buf_le = new Buffer([4,3,2,1,8,7,6,5]); + + var num_be = bignum + .fromBuffer(buf_be, { size : 4, endian : 'big' }) + .toString() + ; + var num_le = bignum + .fromBuffer(buf_le, { size : 4, endian : 'little' }) + .toString() + ; + + assert.eql(num_be, num_le); +}; + +exports.buf_high_bits = function () { + var buf_be = new Buffer([ + 201,202,203,204, + 205,206,207,208 + ]); + var buf_le = new Buffer([ + 204,203,202,201, + 208,207,206,205 + ]); + + var num_be = bignum + .fromBuffer(buf_be, { size : 4, endian : 'big' }) + .toString() + ; + var num_le = bignum + .fromBuffer(buf_le, { size : 4, endian : 'little' }) + .toString() + ; + + assert.eql(num_be, num_le); +}; + +exports.buf_to_from = function () { + var nums = [ + 0, 1, 10, 15, 3, 16, + 7238, 1337, 31337, 505050, + '172389721984375328763297498273498732984324', + '32848432742', + '12988282841231897498217398217398127983721983719283721', + '718293798217398217312387213972198321' + ]; + + nums.forEach(function (num) { + var b = bignum(num); + var u = b.toBuffer(); + + assert.ok(u); + assert.eql( + bignum.fromBuffer(u).toString(), + b.toString() + ); + }); + + assert.throws(function () { + bignum(-1).toBuffer(); // can't pack negative numbers yet + }); +}; + +exports.toBuf = function () { + var buf = new Buffer([ 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f ]); + var b = bignum( + 0x0a * 256*256*256*256*256 + + 0x0b * 256*256*256*256 + + 0x0c * 256*256*256 + + 0x0d * 256*256 + + 0x0e * 256 + + 0x0f + ); + + assert.eql(b.toString(16), '0a0b0c0d0e0f'); + + assert.eql( + [].slice.call(b.toBuffer({ endian : 'big', size : 2 })), + [ 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f ] + ); + + assert.eql( + [].slice.call(b.toBuffer({ endian : 'little', size : 2 })), + [ 0x0b, 0x0a, 0x0d, 0x0c, 0x0f, 0x0e ] + ); + + assert.eql( + bignum.fromBuffer(buf).toString(16), + b.toString(16) + ); + + assert.eql( + [].slice.call(bignum(43135012110).toBuffer({ + endian : 'little', size : 4 + })), + [ 0x0a, 0x00, 0x00, 0x00, 0x0e, 0x0d, 0x0c, 0x0b ] + ); + + assert.eql( + [].slice.call(bignum(43135012110).toBuffer({ + endian : 'big', size : 4 + })), + [ 0x00, 0x00, 0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e ] + ); +}; + +exports.zeroPad = function () { + var b = bignum(0x123456); + + assert.eql( + [].slice.call(b.toBuffer({ endian : 'big', size:4 })), + [ 0x00, 0x12, 0x34, 0x56 ] + ); + + assert.eql( + [].slice.call(b.toBuffer({ endian : 'little', size:4 })), + [ 0x56, 0x34, 0x12, 0x00 ] + ); +}; + +exports.toMpint = function () { + // test values taken directly out of + // http://tools.ietf.org/html/rfc4251#page-10 + + var refs = { + '0' : new Buffer([ 0x00, 0x00, 0x00, 0x00 ]), + '9a378f9b2e332a7' : new Buffer([ + 0x00, 0x00, 0x00, 0x08, + 0x09, 0xa3, 0x78, 0xf9, + 0xb2, 0xe3, 0x32, 0xa7, + ]), + '80' : new Buffer([ 0x00, 0x00, 0x00, 0x02, 0x00, 0x80 ]), + '-1234' : new Buffer([ 0x00, 0x00, 0x00, 0x02, 0xed, 0xcc ]), + '-deadbeef' : new Buffer([ + 0x00, 0x00, 0x00, 0x05, 0xff, 0x21, 0x52, 0x41, 0x11 + ]), + }; + + Object.keys(refs).forEach(function (key) { + var buf0 = bignum(key, 16).toBuffer('mpint'); + var buf1 = refs[key]; + + assert.eql( + buf0, buf1, + buf0.inspect() + ' != ' + buf1.inspect() + + ' for bignum(' + key + ')' + ); + }); +}; + +if (process.argv[1] === __filename) { + assert.eql = assert.deepEqual; + Object.keys(exports).forEach(function (ex) { + exports[ex](); + }); + + if ("function" === typeof gc) { + gc(); + } +} diff --git a/node_modules/bignum/test/seed.js b/node_modules/bignum/test/seed.js new file mode 100644 index 0000000..69bcb30 --- /dev/null +++ b/node_modules/bignum/test/seed.js @@ -0,0 +1,51 @@ +var assert = require('assert'); +var exec = require('child_process').exec; + +exports.rand = function () { + var to = setTimeout(function () { + assert.fail('never executed'); + }, 5000); + + var cmd = 'node -e \'console.log(require(' + + JSON.stringify(__dirname + '/../') + + ').rand(1000).toString())\'' + ; + exec(cmd, function (err1, r1) { + exec(cmd, function (err2, r2) { + clearTimeout(to); + + assert.ok(!err1); + assert.ok(!err2); + + assert.ok( + r1.match(/^\d+\n/), + JSON.stringify(r1) + ' is not an integer' + ); + assert.ok( + r2.match(/^\d+\n/), + JSON.stringify(r2) + ' is not an integer' + ); + + var n1 = parseInt(r1.split('\n')[0], 10); + var n2 = parseInt(r2.split('\n')[0], 10); + + assert.ok(n1 >= 0, 'n1 >= 0'); + assert.ok(n2 >= 0, 'n2 >= 0'); + assert.ok(n1 < 1000, 'n1 < 1000'); + assert.ok(n2 < 1000, 'n2 < 1000'); + + assert.ok(n1 != n2, 'n1 != n2'); + }) + }); +} + +if (process.argv[1] === __filename) { + assert.eql = assert.deepEqual; + Object.keys(exports).forEach(function (ex) { + exports[ex](); + }); + + if ("function" === typeof gc) { + gc(); + } +} diff --git a/node_modules/binpack/.npmignore b/node_modules/binpack/.npmignore new file mode 100644 index 0000000..da77833 --- /dev/null +++ b/node_modules/binpack/.npmignore @@ -0,0 +1,4 @@ +build/ +binpack.node +node_modules +.lock-wscript diff --git a/node_modules/binpack/COPYING b/node_modules/binpack/COPYING new file mode 100644 index 0000000..3c10e66 --- /dev/null +++ b/node_modules/binpack/COPYING @@ -0,0 +1,14 @@ +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/node_modules/binpack/binding.gyp b/node_modules/binpack/binding.gyp new file mode 100644 index 0000000..005ba15 --- /dev/null +++ b/node_modules/binpack/binding.gyp @@ -0,0 +1,8 @@ +{ + "targets": [ + { + "target_name": "binpack", + "sources": [ "src/binpack.cpp" ] + } + ] +} \ No newline at end of file diff --git a/node_modules/binpack/build/Makefile b/node_modules/binpack/build/Makefile new file mode 100644 index 0000000..7babca8 --- /dev/null +++ b/node_modules/binpack/build/Makefile @@ -0,0 +1,332 @@ +# We borrow heavily from the kernel build setup, though we are simpler since +# we don't have Kconfig tweaking settings on us. + +# The implicit make rules have it looking for RCS files, among other things. +# We instead explicitly write all the rules we care about. +# It's even quicker (saves ~200ms) to pass -r on the command line. +MAKEFLAGS=-r + +# The source directory tree. +srcdir := .. +abs_srcdir := $(abspath $(srcdir)) + +# The name of the builddir. +builddir_name ?= . + +# The V=1 flag on command line makes us verbosely print command lines. +ifdef V + quiet= +else + quiet=quiet_ +endif + +# Specify BUILDTYPE=Release on the command line for a release build. +BUILDTYPE ?= Release + +# Directory all our build output goes into. +# Note that this must be two directories beneath src/ for unit tests to pass, +# as they reach into the src/ directory for data with relative paths. +builddir ?= $(builddir_name)/$(BUILDTYPE) +abs_builddir := $(abspath $(builddir)) +depsdir := $(builddir)/.deps + +# Object output directory. +obj := $(builddir)/obj +abs_obj := $(abspath $(obj)) + +# We build up a list of every single one of the targets so we can slurp in the +# generated dependency rule Makefiles in one pass. +all_deps := + + + +CC.target ?= $(CC) +CFLAGS.target ?= $(CFLAGS) +CXX.target ?= $(CXX) +CXXFLAGS.target ?= $(CXXFLAGS) +LINK.target ?= $(LINK) +LDFLAGS.target ?= $(LDFLAGS) +AR.target ?= $(AR) + +# C++ apps need to be linked with g++. +# +# Note: flock is used to seralize linking. Linking is a memory-intensive +# process so running parallel links can often lead to thrashing. To disable +# the serialization, override LINK via an envrionment variable as follows: +# +# export LINK=g++ +# +# This will allow make to invoke N linker processes as specified in -jN. +LINK ?= flock $(builddir)/linker.lock $(CXX.target) + +# TODO(evan): move all cross-compilation logic to gyp-time so we don't need +# to replicate this environment fallback in make as well. +CC.host ?= gcc +CFLAGS.host ?= +CXX.host ?= g++ +CXXFLAGS.host ?= +LINK.host ?= $(CXX.host) +LDFLAGS.host ?= +AR.host ?= ar + +# Define a dir function that can handle spaces. +# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions +# "leading spaces cannot appear in the text of the first argument as written. +# These characters can be put into the argument value by variable substitution." +empty := +space := $(empty) $(empty) + +# http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces +replace_spaces = $(subst $(space),?,$1) +unreplace_spaces = $(subst ?,$(space),$1) +dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1))) + +# Flags to make gcc output dependency info. Note that you need to be +# careful here to use the flags that ccache and distcc can understand. +# We write to a dep file on the side first and then rename at the end +# so we can't end up with a broken dep file. +depfile = $(depsdir)/$(call replace_spaces,$@).d +DEPFLAGS = -MMD -MF $(depfile).raw + +# We have to fixup the deps output in a few ways. +# (1) the file output should mention the proper .o file. +# ccache or distcc lose the path to the target, so we convert a rule of +# the form: +# foobar.o: DEP1 DEP2 +# into +# path/to/foobar.o: DEP1 DEP2 +# (2) we want missing files not to cause us to fail to build. +# We want to rewrite +# foobar.o: DEP1 DEP2 \ +# DEP3 +# to +# DEP1: +# DEP2: +# DEP3: +# so if the files are missing, they're just considered phony rules. +# We have to do some pretty insane escaping to get those backslashes +# and dollar signs past make, the shell, and sed at the same time. +# Doesn't work with spaces, but that's fine: .d files have spaces in +# their names replaced with other characters. +define fixup_dep +# The depfile may not exist if the input file didn't have any #includes. +touch $(depfile).raw +# Fixup path as in (1). +sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile) +# Add extra rules as in (2). +# We remove slashes and replace spaces with new lines; +# remove blank lines; +# delete the first line and append a colon to the remaining lines. +sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ + grep -v '^$$' |\ + sed -e 1d -e 's|$$|:|' \ + >> $(depfile) +rm $(depfile).raw +endef + +# Command definitions: +# - cmd_foo is the actual command to run; +# - quiet_cmd_foo is the brief-output summary of the command. + +quiet_cmd_cc = CC($(TOOLSET)) $@ +cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $< + +quiet_cmd_cxx = CXX($(TOOLSET)) $@ +cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< + +quiet_cmd_touch = TOUCH $@ +cmd_touch = touch $@ + +quiet_cmd_copy = COPY $@ +# send stderr to /dev/null to ignore messages when linking directories. +cmd_copy = rm -rf "$@" && cp -af "$<" "$@" + +quiet_cmd_alink = AR($(TOOLSET)) $@ +cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) + +quiet_cmd_alink_thin = AR($(TOOLSET)) $@ +cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) + +# Due to circular dependencies between libraries :(, we wrap the +# special "figure out circular dependencies" flags around the entire +# input list during linking. +quiet_cmd_link = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) + +# We support two kinds of shared objects (.so): +# 1) shared_library, which is just bundling together many dependent libraries +# into a link line. +# 2) loadable_module, which is generating a module intended for dlopen(). +# +# They differ only slightly: +# In the former case, we want to package all dependent code into the .so. +# In the latter case, we want to package just the API exposed by the +# outermost module. +# This means shared_library uses --whole-archive, while loadable_module doesn't. +# (Note that --whole-archive is incompatible with the --start-group used in +# normal linking.) + +# Other shared-object link notes: +# - Set SONAME to the library filename so our binaries don't reference +# the local, absolute paths used on the link command-line. +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) + + +# Define an escape_quotes function to escape single quotes. +# This allows us to handle quotes properly as long as we always use +# use single quotes and escape_quotes. +escape_quotes = $(subst ','\'',$(1)) +# This comment is here just to include a ' to unconfuse syntax highlighting. +# Define an escape_vars function to escape '$' variable syntax. +# This allows us to read/write command lines with shell variables (e.g. +# $LD_LIBRARY_PATH), without triggering make substitution. +escape_vars = $(subst $$,$$$$,$(1)) +# Helper that expands to a shell command to echo a string exactly as it is in +# make. This uses printf instead of echo because printf's behaviour with respect +# to escape sequences is more portable than echo's across different shells +# (e.g., dash, bash). +exact_echo = printf '%s\n' '$(call escape_quotes,$(1))' + +# Helper to compare the command we're about to run against the command +# we logged the last time we ran the command. Produces an empty +# string (false) when the commands match. +# Tricky point: Make has no string-equality test function. +# The kernel uses the following, but it seems like it would have false +# positives, where one string reordered its arguments. +# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ +# $(filter-out $(cmd_$@), $(cmd_$(1)))) +# We instead substitute each for the empty string into the other, and +# say they're equal if both substitutions produce the empty string. +# .d files contain ? instead of spaces, take that into account. +command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\ + $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) + +# Helper that is non-empty when a prerequisite changes. +# Normally make does this implicitly, but we force rules to always run +# so we can check their command lines. +# $? -- new prerequisites +# $| -- order-only dependencies +prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) + +# Helper that executes all postbuilds until one fails. +define do_postbuilds + @E=0;\ + for p in $(POSTBUILDS); do\ + eval $$p;\ + E=$$?;\ + if [ $$E -ne 0 ]; then\ + break;\ + fi;\ + done;\ + if [ $$E -ne 0 ]; then\ + rm -rf "$@";\ + exit $$E;\ + fi +endef + +# do_cmd: run a command via the above cmd_foo names, if necessary. +# Should always run for a given target to handle command-line changes. +# Second argument, if non-zero, makes it do asm/C/C++ dependency munging. +# Third argument, if non-zero, makes it do POSTBUILDS processing. +# Note: We intentionally do NOT call dirx for depfile, since it contains ? for +# spaces already and dirx strips the ? characters. +define do_cmd +$(if $(or $(command_changed),$(prereq_changed)), + @$(call exact_echo, $($(quiet)cmd_$(1))) + @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" + $(if $(findstring flock,$(word 1,$(cmd_$1))), + @$(cmd_$(1)) + @echo " $(quiet_cmd_$(1)): Finished", + @$(cmd_$(1)) + ) + @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) + @$(if $(2),$(fixup_dep)) + $(if $(and $(3), $(POSTBUILDS)), + $(call do_postbuilds) + ) +) +endef + +# Declare the "all" target first so it is the default, +# even though we don't have the deps yet. +.PHONY: all +all: + +# make looks for ways to re-generate included makefiles, but in our case, we +# don't have a direct way. Explicitly telling make that it has nothing to do +# for them makes it go faster. +%.d: ; + +# Use FORCE_DO_CMD to force a target to run. Should be coupled with +# do_cmd. +.PHONY: FORCE_DO_CMD +FORCE_DO_CMD: + +TOOLSET := target +# Suffix rules, putting all outputs into $(obj). +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD + @$(call do_cmd,cc,1) + +# Try building from generated source, too. +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD + @$(call do_cmd,cc,1) + +$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD + @$(call do_cmd,cc,1) + + +ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ + $(findstring $(join ^,$(prefix)),\ + $(join ^,binpack.target.mk)))),) + include binpack.target.mk +endif + +quiet_cmd_regen_makefile = ACTION Regenerating $@ +cmd_regen_makefile = cd $(srcdir); /usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/home/matt/site/node_modules/binpack/build/config.gypi -I/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/home/matt/.node-gyp/0.10.24/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/home/matt/.node-gyp/0.10.24" "-Dmodule_root_dir=/home/matt/site/node_modules/binpack" binding.gyp +Makefile: $(srcdir)/../../../.node-gyp/0.10.24/common.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi + $(call do_cmd,regen_makefile) + +# "all" is a concatenation of the "all" targets from all the included +# sub-makefiles. This is just here to clarify. +all: + +# Add in dependency-tracking rules. $(all_deps) is the list of every single +# target in our tree. Only consider the ones with .d (dependency) info: +d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) +ifneq ($(d_files),) + include $(d_files) +endif diff --git a/node_modules/binpack/build/Release/.deps/Release/binpack.node.d b/node_modules/binpack/build/Release/.deps/Release/binpack.node.d new file mode 100644 index 0000000..1b5c603 --- /dev/null +++ b/node_modules/binpack/build/Release/.deps/Release/binpack.node.d @@ -0,0 +1 @@ +cmd_Release/binpack.node := rm -rf "Release/binpack.node" && cp -af "Release/obj.target/binpack.node" "Release/binpack.node" diff --git a/node_modules/binpack/build/Release/.deps/Release/obj.target/binpack.node.d b/node_modules/binpack/build/Release/.deps/Release/obj.target/binpack.node.d new file mode 100644 index 0000000..e3dd02d --- /dev/null +++ b/node_modules/binpack/build/Release/.deps/Release/obj.target/binpack.node.d @@ -0,0 +1 @@ +cmd_Release/obj.target/binpack.node := flock ./Release/linker.lock g++ -shared -pthread -rdynamic -m64 -Wl,-soname=binpack.node -o Release/obj.target/binpack.node -Wl,--start-group Release/obj.target/binpack/src/binpack.o -Wl,--end-group diff --git a/node_modules/binpack/build/Release/.deps/Release/obj.target/binpack/src/binpack.o.d b/node_modules/binpack/build/Release/.deps/Release/obj.target/binpack/src/binpack.o.d new file mode 100644 index 0000000..a366adf --- /dev/null +++ b/node_modules/binpack/build/Release/.deps/Release/obj.target/binpack/src/binpack.o.d @@ -0,0 +1,23 @@ +cmd_Release/obj.target/binpack/src/binpack.o := g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/matt/.node-gyp/0.10.24/src -I/home/matt/.node-gyp/0.10.24/deps/uv/include -I/home/matt/.node-gyp/0.10.24/deps/v8/include -fPIC -Wall -Wextra -Wno-unused-parameter -pthread -m64 -O2 -fno-strict-aliasing -fno-tree-vrp -fno-omit-frame-pointer -fno-rtti -fno-exceptions -MMD -MF ./Release/.deps/Release/obj.target/binpack/src/binpack.o.d.raw -c -o Release/obj.target/binpack/src/binpack.o ../src/binpack.cpp +Release/obj.target/binpack/src/binpack.o: ../src/binpack.cpp \ + /home/matt/.node-gyp/0.10.24/deps/v8/include/v8.h \ + /home/matt/.node-gyp/0.10.24/deps/v8/include/v8stdint.h \ + /home/matt/.node-gyp/0.10.24/src/node.h \ + /home/matt/.node-gyp/0.10.24/deps/uv/include/uv.h \ + /home/matt/.node-gyp/0.10.24/deps/uv/include/uv-private/uv-unix.h \ + /home/matt/.node-gyp/0.10.24/deps/uv/include/uv-private/ngx-queue.h \ + /home/matt/.node-gyp/0.10.24/deps/uv/include/uv-private/uv-linux.h \ + /home/matt/.node-gyp/0.10.24/src/node_object_wrap.h \ + /home/matt/.node-gyp/0.10.24/src/node.h \ + /home/matt/.node-gyp/0.10.24/src/node_buffer.h +../src/binpack.cpp: +/home/matt/.node-gyp/0.10.24/deps/v8/include/v8.h: +/home/matt/.node-gyp/0.10.24/deps/v8/include/v8stdint.h: +/home/matt/.node-gyp/0.10.24/src/node.h: +/home/matt/.node-gyp/0.10.24/deps/uv/include/uv.h: +/home/matt/.node-gyp/0.10.24/deps/uv/include/uv-private/uv-unix.h: +/home/matt/.node-gyp/0.10.24/deps/uv/include/uv-private/ngx-queue.h: +/home/matt/.node-gyp/0.10.24/deps/uv/include/uv-private/uv-linux.h: +/home/matt/.node-gyp/0.10.24/src/node_object_wrap.h: +/home/matt/.node-gyp/0.10.24/src/node.h: +/home/matt/.node-gyp/0.10.24/src/node_buffer.h: diff --git a/node_modules/binpack/build/Release/binpack.node b/node_modules/binpack/build/Release/binpack.node new file mode 100755 index 0000000..5eb290d Binary files /dev/null and b/node_modules/binpack/build/Release/binpack.node differ diff --git a/node_modules/binpack/build/Release/linker.lock b/node_modules/binpack/build/Release/linker.lock new file mode 100644 index 0000000..e69de29 diff --git a/node_modules/binpack/build/Release/obj.target/binpack.node b/node_modules/binpack/build/Release/obj.target/binpack.node new file mode 100755 index 0000000..5eb290d Binary files /dev/null and b/node_modules/binpack/build/Release/obj.target/binpack.node differ diff --git a/node_modules/binpack/build/Release/obj.target/binpack/src/binpack.o b/node_modules/binpack/build/Release/obj.target/binpack/src/binpack.o new file mode 100644 index 0000000..e797205 Binary files /dev/null and b/node_modules/binpack/build/Release/obj.target/binpack/src/binpack.o differ diff --git a/node_modules/binpack/build/binding.Makefile b/node_modules/binpack/build/binding.Makefile new file mode 100644 index 0000000..29d8974 --- /dev/null +++ b/node_modules/binpack/build/binding.Makefile @@ -0,0 +1,6 @@ +# This file is generated by gyp; do not edit. + +export builddir_name ?= build/./. +.PHONY: all +all: + $(MAKE) binpack diff --git a/node_modules/binpack/build/binpack.target.mk b/node_modules/binpack/build/binpack.target.mk new file mode 100644 index 0000000..401696c --- /dev/null +++ b/node_modules/binpack/build/binpack.target.mk @@ -0,0 +1,130 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := binpack +DEFS_Debug := \ + '-D_LARGEFILE_SOURCE' \ + '-D_FILE_OFFSET_BITS=64' \ + '-DBUILDING_NODE_EXTENSION' \ + '-DDEBUG' \ + '-D_DEBUG' + +# Flags passed to all source files. +CFLAGS_Debug := \ + -fPIC \ + -Wall \ + -Wextra \ + -Wno-unused-parameter \ + -pthread \ + -m64 \ + -g \ + -O0 + +# Flags passed to only C files. +CFLAGS_C_Debug := + +# Flags passed to only C++ files. +CFLAGS_CC_Debug := \ + -fno-rtti \ + -fno-exceptions + +INCS_Debug := \ + -I/home/matt/.node-gyp/0.10.24/src \ + -I/home/matt/.node-gyp/0.10.24/deps/uv/include \ + -I/home/matt/.node-gyp/0.10.24/deps/v8/include + +DEFS_Release := \ + '-D_LARGEFILE_SOURCE' \ + '-D_FILE_OFFSET_BITS=64' \ + '-DBUILDING_NODE_EXTENSION' + +# Flags passed to all source files. +CFLAGS_Release := \ + -fPIC \ + -Wall \ + -Wextra \ + -Wno-unused-parameter \ + -pthread \ + -m64 \ + -O2 \ + -fno-strict-aliasing \ + -fno-tree-vrp \ + -fno-omit-frame-pointer + +# Flags passed to only C files. +CFLAGS_C_Release := + +# Flags passed to only C++ files. +CFLAGS_CC_Release := \ + -fno-rtti \ + -fno-exceptions + +INCS_Release := \ + -I/home/matt/.node-gyp/0.10.24/src \ + -I/home/matt/.node-gyp/0.10.24/deps/uv/include \ + -I/home/matt/.node-gyp/0.10.24/deps/v8/include + +OBJS := \ + $(obj).target/$(TARGET)/src/binpack.o + +# Add to the list of files we specially track dependencies for. +all_deps += $(OBJS) + +# CFLAGS et al overrides must be target-local. +# See "Target-specific Variable Values" in the GNU Make manual. +$(OBJS): TOOLSET := $(TOOLSET) +$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) +$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) + +# Suffix rules, putting all outputs into $(obj). + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +# Try building from generated source, too. + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +# End of this set of suffix rules +### Rules for final target. +LDFLAGS_Debug := \ + -pthread \ + -rdynamic \ + -m64 + +LDFLAGS_Release := \ + -pthread \ + -rdynamic \ + -m64 + +LIBS := + +$(obj).target/binpack.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE)) +$(obj).target/binpack.node: LIBS := $(LIBS) +$(obj).target/binpack.node: TOOLSET := $(TOOLSET) +$(obj).target/binpack.node: $(OBJS) FORCE_DO_CMD + $(call do_cmd,solink_module) + +all_deps += $(obj).target/binpack.node +# Add target alias +.PHONY: binpack +binpack: $(builddir)/binpack.node + +# Copy this to the executable output path. +$(builddir)/binpack.node: TOOLSET := $(TOOLSET) +$(builddir)/binpack.node: $(obj).target/binpack.node FORCE_DO_CMD + $(call do_cmd,copy) + +all_deps += $(builddir)/binpack.node +# Short alias for building this executable. +.PHONY: binpack.node +binpack.node: $(obj).target/binpack.node $(builddir)/binpack.node + +# Add executable to "all" target. +.PHONY: all +all: $(builddir)/binpack.node + diff --git a/node_modules/binpack/build/config.gypi b/node_modules/binpack/build/config.gypi new file mode 100644 index 0000000..f5332b9 --- /dev/null +++ b/node_modules/binpack/build/config.gypi @@ -0,0 +1,115 @@ +# Do not edit. File was generated by node-gyp's "configure" step +{ + "target_defaults": { + "cflags": [], + "default_configuration": "Release", + "defines": [], + "include_dirs": [], + "libraries": [] + }, + "variables": { + "clang": 0, + "gcc_version": 48, + "host_arch": "x64", + "node_install_npm": "true", + "node_prefix": "/usr", + "node_shared_cares": "false", + "node_shared_http_parser": "false", + "node_shared_libuv": "false", + "node_shared_openssl": "false", + "node_shared_v8": "false", + "node_shared_zlib": "false", + "node_tag": "", + "node_unsafe_optimizations": 0, + "node_use_dtrace": "false", + "node_use_etw": "false", + "node_use_openssl": "true", + "node_use_perfctr": "false", + "node_use_systemtap": "false", + "python": "/usr/bin/python", + "target_arch": "x64", + "v8_enable_gdbjit": 0, + "v8_no_strict_aliasing": 1, + "v8_use_snapshot": "false", + "nodedir": "/home/matt/.node-gyp/0.10.24", + "copy_dev_lib": "true", + "standalone_static_library": 1, + "cache_lock_stale": "60000", + "sign_git_tag": "", + "always_auth": "", + "user_agent": "node/v0.10.24 linux x64", + "bin_links": "true", + "key": "", + "description": "true", + "fetch_retries": "2", + "heading": "npm", + "user": "", + "force": "", + "cache_min": "10", + "init_license": "ISC", + "editor": "vi", + "rollback": "true", + "cache_max": "null", + "userconfig": "/home/matt/.npmrc", + "engine_strict": "", + "init_author_name": "", + "init_author_url": "", + "tmp": "/home/matt/tmp", + "depth": "null", + "save_dev": "", + "usage": "", + "https_proxy": "", + "onload_script": "", + "rebuild_bundle": "true", + "save_bundle": "", + "shell": "/bin/bash", + "prefix": "/usr", + "registry": "https://registry.npmjs.org/", + "browser": "", + "cache_lock_wait": "10000", + "save_optional": "", + "searchopts": "", + "versions": "", + "cache": "/home/matt/.npm", + "ignore_scripts": "", + "searchsort": "name", + "version": "", + "local_address": "", + "viewer": "man", + "color": "true", + "fetch_retry_mintimeout": "10000", + "umask": "18", + "fetch_retry_maxtimeout": "60000", + "message": "%s", + "cert": "", + "global": "", + "link": "", + "save": "", + "unicode": "true", + "long": "", + "production": "", + "unsafe_perm": "true", + "node_version": "v0.10.24", + "tag": "latest", + "git_tag_version": "true", + "shrinkwrap": "true", + "fetch_retry_factor": "10", + "npat": "", + "proprietary_attribs": "true", + "strict_ssl": "true", + "username": "", + "dev": "", + "globalconfig": "/usr/etc/npmrc", + "init_module": "/home/matt/.npm-init.js", + "parseable": "", + "globalignorefile": "/usr/etc/npmignore", + "cache_lock_retries": "10", + "group": "1000", + "init_author_email": "", + "searchexclude": "", + "git": "git", + "optional": "true", + "email": "", + "json": "" + } +} diff --git a/node_modules/binpack/changes.md b/node_modules/binpack/changes.md new file mode 100644 index 0000000..3d00d42 --- /dev/null +++ b/node_modules/binpack/changes.md @@ -0,0 +1,6 @@ +# Changelog + +## 0.0.3 + Switched "repositories" to "repository" in package.json. +## 0.0.2 + Updated documentation \ No newline at end of file diff --git a/node_modules/binpack/index.js b/node_modules/binpack/index.js new file mode 100644 index 0000000..ac840f2 --- /dev/null +++ b/node_modules/binpack/index.js @@ -0,0 +1 @@ +module.exports = require('bindings')('binpack.node') \ No newline at end of file diff --git a/node_modules/binpack/node_modules/bindings/README.md b/node_modules/binpack/node_modules/bindings/README.md new file mode 100644 index 0000000..585cf51 --- /dev/null +++ b/node_modules/binpack/node_modules/bindings/README.md @@ -0,0 +1,97 @@ +node-bindings +============= +### Helper module for loading your native module's .node file + +This is a helper module for authors of Node.js native addon modules. +It is basically the "swiss army knife" of `require()`ing your native module's +`.node` file. + +Throughout the course of Node's native addon history, addons have ended up being +compiled in a variety of different places, depending on which build tool and which +version of node was used. To make matters worse, now the _gyp_ build tool can +produce either a _Release_ or _Debug_ build, each being built into different +locations. + +This module checks _all_ the possible locations that a native addon would be built +at, and returns the first one that loads successfully. + + +Installation +------------ + +Install with `npm`: + +``` bash +$ npm install bindings +``` + +Or add it to the `"dependencies"` section of your _package.json_ file. + + +Example +------- + +`require()`ing the proper bindings file for the current node version, platform +and architecture is as simple as: + +``` js +var bindings = require('bindings')('binding.node') + +// Use your bindings defined in your C files +bindings.your_c_function() +``` + + +Nice Error Output +----------------- + +When the `.node` file could not be loaded, `node-bindings` throws an Error with +a nice error message telling you exactly what was tried. You can also check the +`err.tries` Array property. + +``` +Error: Could not load the bindings file. Tried: + → /Users/nrajlich/ref/build/binding.node + → /Users/nrajlich/ref/build/Debug/binding.node + → /Users/nrajlich/ref/build/Release/binding.node + → /Users/nrajlich/ref/out/Debug/binding.node + → /Users/nrajlich/ref/Debug/binding.node + → /Users/nrajlich/ref/out/Release/binding.node + → /Users/nrajlich/ref/Release/binding.node + → /Users/nrajlich/ref/build/default/binding.node + → /Users/nrajlich/ref/compiled/0.8.2/darwin/x64/binding.node + at bindings (/Users/nrajlich/ref/node_modules/bindings/bindings.js:84:13) + at Object. (/Users/nrajlich/ref/lib/ref.js:5:47) + at Module._compile (module.js:449:26) + at Object.Module._extensions..js (module.js:467:10) + at Module.load (module.js:356:32) + at Function.Module._load (module.js:312:12) + ... +``` + + +License +------- + +(The MIT License) + +Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/binpack/node_modules/bindings/bindings.js b/node_modules/binpack/node_modules/bindings/bindings.js new file mode 100644 index 0000000..a40029b --- /dev/null +++ b/node_modules/binpack/node_modules/bindings/bindings.js @@ -0,0 +1,159 @@ + +/** + * Module dependencies. + */ + +var fs = require('fs') + , path = require('path') + , join = path.join + , dirname = path.dirname + , exists = fs.existsSync || path.existsSync + , defaults = { + arrow: process.env.NODE_BINDINGS_ARROW || ' → ' + , compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled' + , platform: process.platform + , arch: process.arch + , version: process.versions.node + , bindings: 'bindings.node' + , try: [ + // node-gyp's linked version in the "build" dir + [ 'module_root', 'build', 'bindings' ] + // node-waf and gyp_addon (a.k.a node-gyp) + , [ 'module_root', 'build', 'Debug', 'bindings' ] + , [ 'module_root', 'build', 'Release', 'bindings' ] + // Debug files, for development (legacy behavior, remove for node v0.9) + , [ 'module_root', 'out', 'Debug', 'bindings' ] + , [ 'module_root', 'Debug', 'bindings' ] + // Release files, but manually compiled (legacy behavior, remove for node v0.9) + , [ 'module_root', 'out', 'Release', 'bindings' ] + , [ 'module_root', 'Release', 'bindings' ] + // Legacy from node-waf, node <= 0.4.x + , [ 'module_root', 'build', 'default', 'bindings' ] + // Production "Release" buildtype binary (meh...) + , [ 'module_root', 'compiled', 'version', 'platform', 'arch', 'bindings' ] + ] + } + +/** + * The main `bindings()` function loads the compiled bindings for a given module. + * It uses V8's Error API to determine the parent filename that this function is + * being invoked from, which is then used to find the root directory. + */ + +function bindings (opts) { + + // Argument surgery + if (typeof opts == 'string') { + opts = { bindings: opts } + } else if (!opts) { + opts = {} + } + opts.__proto__ = defaults + + // Get the module root + if (!opts.module_root) { + opts.module_root = exports.getRoot(exports.getFileName()) + } + + // Ensure the given bindings name ends with .node + if (path.extname(opts.bindings) != '.node') { + opts.bindings += '.node' + } + + var tries = [] + , i = 0 + , l = opts.try.length + , n + , b + , err + + for (; i (/Users/nrajlich/ref/lib/ref.js:5:47)\n at Module._compile (module.js:449:26)\n at Object.Module._extensions..js (module.js:467:10)\n at Module.load (module.js:356:32)\n at Function.Module._load (module.js:312:12)\n ...\n```\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/TooTallNate/node-bindings/issues" + }, + "homepage": "https://github.com/TooTallNate/node-bindings", + "_id": "bindings@1.1.1", + "_from": "bindings@*" +} diff --git a/node_modules/binpack/package.json b/node_modules/binpack/package.json new file mode 100644 index 0000000..c6406da --- /dev/null +++ b/node_modules/binpack/package.json @@ -0,0 +1,46 @@ +{ + "name": "binpack", + "version": "0.0.14", + "main": "binpack", + "author": { + "name": "Russell McClellan", + "email": "russell.mcclellan@gmail.com", + "url": "http://www.ghostfact.com" + }, + "description": "Minimalist numeric binary packing utilities for node.js", + "keywords": [ + "binary", + "pack", + "unpack" + ], + "repository": { + "type": "git", + "url": "http://github.com/russellmcc/node-binpack.git" + }, + "dependencies": { + "bindings": "*" + }, + "devDependencies": { + "vows": "*", + "coffee-script": "*" + }, + "directories": { + "src": "src" + }, + "engines": { + "node": ">=0.6.0" + }, + "scripts": { + "test": "vows tests/*", + "install": "node-gyp rebuild" + }, + "gypfile": true, + "readme": "# binpack\n\n_Minimalist numeric binary packing utilities for node.js_\n\n## What's all this?\n\nThis is an intentionally simple binary packing/unpacking package for node.js for programmers who prefer to write most of their parsing code in javascript. This exposes some common binary formats for numbers.\n\nsee the included COPYING file for licensing.\n\nthe core of the module is the set of `pack`/`unpack` pair functions. The meaning should be clear from the name - for example, `packInt32` packs a given javascript number into a 32-bit int inside a 4-byte node.js Buffer, while `unpackFloat32` unpacks a 4-byte node.js Buffer containing a native floating point number into a javascript number.\n\nThe following types are available for both pack and unpack:\n\n Float32 \n Float64 \n Int8\n Int16 \n Int32\n Int64\n UInt8 \n UInt16\n UInt32\n UInt64\n \nEach `pack*` function takes a javascript number and outputs a node.js Buffer.\n\nEach `unpack*` function takes a node.js Buffer and outputs a javascript number.\n\nBoth types of functions take an optional second argument. If this argument is `\"big\"`, the output is put in big endian format. If the argument is `\"little\"`, the output is put in little endian format. If the argument is anything else or non-existent, we default to your machine's native encoding.\n\n## How is this different than the `binary` module on npm?\n\nIt contains floating point values, and it has packing functions", + "readmeFilename": "readme.md", + "bugs": { + "url": "https://github.com/russellmcc/node-binpack/issues" + }, + "homepage": "https://github.com/russellmcc/node-binpack", + "_id": "binpack@0.0.14", + "_from": "binpack@" +} diff --git a/node_modules/binpack/readme.md b/node_modules/binpack/readme.md new file mode 100644 index 0000000..bb2f991 --- /dev/null +++ b/node_modules/binpack/readme.md @@ -0,0 +1,34 @@ +# binpack + +_Minimalist numeric binary packing utilities for node.js_ + +## What's all this? + +This is an intentionally simple binary packing/unpacking package for node.js for programmers who prefer to write most of their parsing code in javascript. This exposes some common binary formats for numbers. + +see the included COPYING file for licensing. + +the core of the module is the set of `pack`/`unpack` pair functions. The meaning should be clear from the name - for example, `packInt32` packs a given javascript number into a 32-bit int inside a 4-byte node.js Buffer, while `unpackFloat32` unpacks a 4-byte node.js Buffer containing a native floating point number into a javascript number. + +The following types are available for both pack and unpack: + + Float32 + Float64 + Int8 + Int16 + Int32 + Int64 + UInt8 + UInt16 + UInt32 + UInt64 + +Each `pack*` function takes a javascript number and outputs a node.js Buffer. + +Each `unpack*` function takes a node.js Buffer and outputs a javascript number. + +Both types of functions take an optional second argument. If this argument is `"big"`, the output is put in big endian format. If the argument is `"little"`, the output is put in little endian format. If the argument is anything else or non-existent, we default to your machine's native encoding. + +## How is this different than the `binary` module on npm? + +It contains floating point values, and it has packing functions \ No newline at end of file diff --git a/node_modules/binpack/src/binpack.cpp b/node_modules/binpack/src/binpack.cpp new file mode 100644 index 0000000..cbc2c21 --- /dev/null +++ b/node_modules/binpack/src/binpack.cpp @@ -0,0 +1,142 @@ +#include +#include +#include +#include +using namespace node; +using namespace v8; + +namespace +{ +Handle except(const char* msg) +{ + return ThrowException(Exception::Error(String::New(msg))); +} + +enum ByteOrder +{ + kNative, + kFlip +}; + +template +t SwapBytes(const t& in) +{ + t out; + const char* in_p = reinterpret_cast(&in); + char* out_p = reinterpret_cast(&out) + sizeof(t) - 1; + + for(; out_p >= reinterpret_cast(&out); --out_p, ++in_p) + { + *out_p = *in_p; + } + + return out; +} + +bool IsPlatformLittleEndian() +{ + int32_t one = 1; + char* one_p = reinterpret_cast(&one); + if(*one_p == 1) + return true; + return false; +} + +ByteOrder GetByteOrder(const Arguments& args) +{ + // default to native. + if(!(args.Length() > 1)) + return kNative; + + Local arg = args[1]; + if(arg->IsString()) + { + char utf8[12]; + arg->ToString()->WriteUtf8(utf8, 10); + if(!std::strncmp(utf8, "big", 10)) + return IsPlatformLittleEndian() ? kFlip : kNative; + if(!std::strncmp(utf8, "little", 10)) + return IsPlatformLittleEndian() ? kNative : kFlip; + } + + return kNative; +} + +template +Handle unpackBuffer(const Arguments& args) +{ + HandleScope scope; + + if(args.Length() < 1) + return except("You must provide at least one argument."); + + if(!Buffer::HasInstance(args[0]->ToObject())) + return except("The first argument must be a buffer."); + + if(Buffer::Length(args[0]->ToObject()) != sizeof(t)) + return except("Buffer is the incorrect length."); + + ByteOrder order = GetByteOrder(args); + + t nativeType = *reinterpret_cast(Buffer::Data(args[0]->ToObject())); + + if(order == kFlip) + nativeType = SwapBytes(nativeType); + + Local num = Number::New(nativeType); + return scope.Close(num); +} + +template +Handle packBuffer(const Arguments& args) +{ + HandleScope scope; + + if(args.Length() < 1) + return except("You must provide at least one argument."); + + if(!args[0]->IsNumber ()) + return except("The first argument must be a number."); + + ByteOrder order = GetByteOrder(args); + + Local num = args[0]->ToNumber(); + t nativeType = num->Value(); + + if(order == kFlip) + nativeType = SwapBytes(nativeType); + + Buffer* buff = Buffer::New(reinterpret_cast(&nativeType), sizeof(nativeType)); + return scope.Close(buff->handle_); +} + +}// private namespace + +extern "C" +{ + static void init(Handle target) + { + NODE_SET_METHOD(target, "unpackFloat32", unpackBuffer); + NODE_SET_METHOD(target, "unpackFloat64", unpackBuffer); + NODE_SET_METHOD(target, "unpackInt8", unpackBuffer); + NODE_SET_METHOD(target, "unpackInt16", unpackBuffer); + NODE_SET_METHOD(target, "unpackInt32", unpackBuffer); + NODE_SET_METHOD(target, "unpackInt64", unpackBuffer); + NODE_SET_METHOD(target, "unpackUInt8", unpackBuffer); + NODE_SET_METHOD(target, "unpackUInt16", unpackBuffer); + NODE_SET_METHOD(target, "unpackUInt32", unpackBuffer); + NODE_SET_METHOD(target, "unpackUInt64", unpackBuffer); + NODE_SET_METHOD(target, "packFloat32", packBuffer); + NODE_SET_METHOD(target, "packFloat64", packBuffer); + NODE_SET_METHOD(target, "packInt8", packBuffer); + NODE_SET_METHOD(target, "packInt16", packBuffer); + NODE_SET_METHOD(target, "packInt32", packBuffer); + NODE_SET_METHOD(target, "packInt64", packBuffer); + NODE_SET_METHOD(target, "packUInt8", packBuffer); + NODE_SET_METHOD(target, "packUInt16", packBuffer); + NODE_SET_METHOD(target, "packUInt32", packBuffer); + NODE_SET_METHOD(target, "packUInt64", packBuffer); + } + + NODE_MODULE(binpack, init); +} \ No newline at end of file diff --git a/node_modules/binpack/tests/test-binpack.coffee b/node_modules/binpack/tests/test-binpack.coffee new file mode 100644 index 0000000..9910bf6 --- /dev/null +++ b/node_modules/binpack/tests/test-binpack.coffee @@ -0,0 +1,64 @@ +vows = require "vows" +assert = require "assert" +binpack = require "../index" + +# do a round trip +okayForOptions = (num, options) -> + return false if options.size? and Math.abs(num) > options.size? + return false if num < 0 and options.unsigned + true + +roundTrip = (type, options) -> + works : (num) -> + return null if not okayForOptions(num, options) + assert.strictEqual (binpack["unpack" + type] binpack["pack" + type] num), num + + "fails plus 1.1" : (num) -> + return null if not okayForOptions(num, options) + assert.notStrictEqual (binpack["unpack" + type] binpack["pack" + type] num + 1.1), num + + "works little endian" : (num) -> + return null if options.onebyte + return null if not okayForOptions(num, options) + assert.strictEqual (binpack["unpack" + type] (binpack["pack" + type] num, "little"), "little"), num + + "works big endian" : (num) -> + return null if options.onebyte + return null if not okayForOptions(num, options) + assert.strictEqual (binpack["unpack" + type] (binpack["pack" + type] num, "big"), "big"), num + + "fails mismatched" : (num) -> + return null if not okayForOptions(num, options) + return null if num is 0 + return null if options.onebyte + assert.notStrictEqual (binpack["unpack" + type] (binpack["pack" + type] num, "little"), "big"), num + +types = + "Float32" : {} + "Float64" : {} + "Int8" : {onebyte : true, size : 128} + "Int16" : {size : 32768} + "Int32" : {} + "Int64" : {} + "UInt8" : {unsigned : true, onebyte : true, size:255} + "UInt16" : {unsigned : true, size : 65535} + "UInt32" : {unsigned : true} + "UInt64" : {unsigned : true} + +# round trip testing makes up the core of the test. +roundTripTests = (num) -> + tests = {topic : num} + for type, options of types + tests[type + "round trip test"] = roundTrip type, options + tests + +vows.describe("binpack").addBatch( + # choose a bunch of random numbers + 'roundTrips for 0' : roundTripTests 0 + 'roundTrips for 12' : roundTripTests 12 + 'roundTrips for -18' : roundTripTests -18 + 'roundTrips for 129' : roundTripTests 129 + 'roundTrips for -400' : roundTripTests -400 + 'roundTrips for 60000' : roundTripTests 60000 + 'roundTrips for 1234567' : roundTripTests 1234567 +).export module diff --git a/node_modules/binpack/wscript b/node_modules/binpack/wscript new file mode 100644 index 0000000..97b24c5 --- /dev/null +++ b/node_modules/binpack/wscript @@ -0,0 +1,17 @@ +import Options +from os import unlink, symlink +from os.path import exists + +def set_options(opt): + opt.tool_options("compiler_cxx") + +def configure(conf): + conf.check_tool("compiler_cxx") + conf.check_tool("node_addon") + conf.env.set_variant("Release") + conf.env.append_value('CXXFLAGS', ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall"]) + +def build(bld): + obj = bld.new_task_gen("cxx", "shlib", "node_addon") + obj.target = "binpack" + obj.source = "src/binpack.cpp" diff --git a/old_blockTemplate.js b/old_blockTemplate.js new file mode 100644 index 0000000..d455aae --- /dev/null +++ b/old_blockTemplate.js @@ -0,0 +1,177 @@ +function BlockTemplate(jobId, data){ + + + this.jobId = jobId; + + //CBlock + + this.nVersion = 1; + this.hashPrevBlock = 0; + this.hashMerkleRoot = 0; + this.nTime = 0; + this.nBits = 0; + this.nNonce = 0; + this.vtx = []; + this.sha256 = null; + this.scrypt = null; + //--- + + + this.jobId = JobStore.nextId(); + + this.submits = []; + + var txHashes = [null].concat(data.transactions.map(function(tx){ + return util.uint256BufferFromHash(tx.hash); + })); + + this.merkleTree = new merkle.Tree(txHashes); + + this.coinbase = new coinbase.CoinbaseTransaction( + data.coinbasevalue, + data.coinbaseaux.flags, + data.height + ); + + this.vtx = [this.coinbase.tx]; + + data.transactions.each(function(tx){ + var t = new coinbase.CTransaction(); + t.deserialize(new Buffer(tx.data, 'hex')); + this.vtx.push(t); + }); + + this.height = data.height; + this.nVersion = data.version; + this.nBits = parseInt(data.bits, 16); + this.hashMerkleRoot = 0; + this.nNonce = 0; + this.curTime = data.curtime; + this.timeDelt = this.curTime - Math.floor(Date.now() / 1000); + this.target = util.uint256_from_compact(this.nBits); + this.prevHashBin = util.reverseBuffer(new Buffer(data.previousblockhash, 'hex')); + this.broadCastArgs = this.buildBroadcastArgs(); +} +BlockTemplate.prototype = { + registerSubmit: function(extraNonce1, extraNonce2, nTime, nonce){ + var t = [extraNonce1, extraNonce2, nTime, nonce]; + + this.submits.forEach(function(s){ + if (s.join(',') == t.join(',')) + return false; + }); + this.submits.push(t); + return true; + }, + + buildBroadcastArgs: function(){ + return [ + this.jobId, + this.prevHashBin.toString('hex'), + this.coinbase.serialized[0].toString('hex'), + this.coinbase.serialized[1].toString('hex'), + this.merkleTree.steps.map(function(s){ + return s.toString('hex'); + }), + binpack.packInt32(this.nVersion, 'big').toString('hex'), + binpack.packUInt32(this.nBits, 'big').toString('hex'), + binpack.packUInt32(this.curTime, 'big').toString('hex'), + true //cleanJobs + ]; + }, + + serializeCoinbase: function(extraNonce1, extraNonce2){ + var parts = this.coinbase.serialized; + return Buffer.concat([ + parts[0], + extraNonce1, + extraNonce2, + parts[1] + ]); + }, + + checkNTime: function(nTime){ + if (nTime < this.curTime) + return false; + + if (nTime > ((Date.now() / 1000) + 7200)) + return false; + + return true; + }, + + serializeHeader: function(merkleRootInt, nTimeBin, nonceBin){ + return Buffer.concat([ + binpack.packInt32(this.version, 'big'), + this.prevHashBin, + util.ser_uint256_be(merkleRootInt), + nTimeBin, + binpack.packUInt32(this.nBits, 'big'), + nonceBin + ]); + }, + + finalize: function(merkleRootInt, extraNonce1Bin, extraNonce2Bin, nTime, nonce){ + this.hashMerkleRoot = merkleRootInt; + this.nTime = nTime; + this.nNonce = nonce; + this.vtx[0].setExtraNonce(Buffer.concat([extraNonce1Bin, extraNonce2Bin])); + this.sha256 = null; + }, + + /* CBlock */ + + deserialize: function(f){ + util.makeBufferReadable(f); + this.nVersion = f.read(4).readInt32LE(0); + this.hashPrevBlock = util.hexFromReversedBuffer(f.read(32)); + this.hashMerkleRoot = util.hexFromReversedBuffer(f.read(32)); + this.nTime = f.read(4).readUInt32LE(0); + this.nBits = f.read(4).readUInt32LE(0); + this.nNonce = f.read(4).readUInt32LE(0); + this.vtx = util.deser_vector(f, coinbase.CTransaction); + }, + + serialize: function(){ + return Buffer.concat([ + binpack.packInt32(this.nVersion, 'little'), + util.uint256BufferFromHash(this.hashPrevBlock), + util.uint256BufferFromHash(this.hashMerkleRoot), + binpack.packUInt32(this.nTime, 'little'), + binpack.packUInt32(this.nBits, 'little'), + binpack.packUInt32(this.nNonce, 'little'), + util.ser_vector(this.vtx) + ]); + }, + + calcSha256: function(){ + if (!this.sha256){ + var r = Buffer.concat([ + binpack.packInt32(this.nVersion, 'little'), + util.uint256BufferFromHash(this.hashPrevBlock), + util.uint256BufferFromHash(this.hashMerkleRoot), + binpack.packUInt32(this.nTime, 'little'), + binpack.packUInt32(this.nBits, 'little'), + binpack.packUInt32(this.nNonce, 'little') + ]); + this.sha256 = util.doublesha(r); + } + return this.sha256; + }, + + calc_scrypt: function(){ + + }, + + is_valid: function(){ + this.calc_sha256(); + var target = bignum.fromBuffer(new Buffer(this.nBits, 'hex')); + if (bignum.fromBuffer(this.sha256).gt(target)) + return false; + var hashes = []; + } + + + /* --- */ + +}; \ No newline at end of file diff --git a/old_shareSubmit.js b/old_shareSubmit.js new file mode 100644 index 0000000..c7e7bda --- /dev/null +++ b/old_shareSubmit.js @@ -0,0 +1,46 @@ +var binpack = require('/usr/lib/node_modules/binpack'); +var bignum = require('/usr/lib/node_modules/bignum'); + +var merkle = require('./merkleTree.js'); +var coinbase = require('./coinbase.js'); +var util = require('./util.js'); + + + +exports.submit = function(job_id, worker_name, extranonce1_bin, extranonce2, ntime, nonce, difficulty){ + + var job = JobStore.find(job_id); + + var extraNonce2Size = coinbase.extranonce_size - ExtraNonceCounter.size(); + + if (extranonce2.length != extraNonce2Size * 2) + return {error: 'rejected'} //Incorrect size of extranonce2 + + if (!job) + return {error: 'unknown-work'} + + if (ntime.length != 8) + return {error: 'rejected'} + + if (!job.check_ntime(parseInt(ntime, 16))) + return {error: 'time-invalid'}; + + if (nonce.length != 8) + return {error: 'rejected'}; + + if (!job.register_submit(extranonce1_bin, extranonce2, ntime ,nonce)) + return {error: 'duplicate'}; + + + var extranonce2_bin = new Buffer(extranonce2, 'hex'); + var ntime_bin = new Buffer(ntime, 'hex'); + var nonce_bin = new Buffer(nonce, 'hex'); + + var coinbase_bin = job.serialize_coinbase(extranonce1_bin, extranonce2_bin); + var coinbase_hash = util.doublesha(coinbase_bin); + + var merkle_root_bin = job.template.merkleTree.withFirst(coinbase_hash); + var merkle_root_int = util.uint + + +}; \ No newline at end of file diff --git a/pool.js b/pool.js new file mode 100644 index 0000000..860102a --- /dev/null +++ b/pool.js @@ -0,0 +1,104 @@ +var net = require('net'); +var fs = require('fs'); + +var bignum = require('/usr/lib/node_modules/bignum'); + +var daemon = require('./daemon.js'); +var stratum = require('./stratum.js'); +var jobManager = require('./jobManager.js'); +var util = require('./util.js'); +var coinbase = require('./coinbase.js'); + + +function Coin(options){ + this.options = options; +} +Coin.prototype = {}; + +var coins = [ + new Coin({ + name: 'Dogecoin', + symbol: 'doge', + algorithm: 'scrypt', + address: 'D5uXR7F6bTCJKRZBqj1D4gyHF9MHAd5oNs', + daemon: { + bin: 'dogecoind', + port: 8332, + user: 'test', + password: 'test', + blocknotify: '"blockNotify.js doge %s"', + startIfOffline: true + } + }) +]; + + +coins.forEach(function(coin){ + + coin.jobManager = new jobManager({ + algorithm: coin.options.algorithm, + address: coin.options.address + }); + coin.jobManager.on('newBlock', function(blockTemplate){ + coin.stratumServer.broadcastMiningJobs(blockTemplate.getJobParams()); + }); + + + coin.daemon = new daemon.interface(coin.options.daemon); + coin.daemon.on('online', function(){ + coin.daemon.cmd( + 'getblocktemplate', + [{"capabilities": [ "coinbasetxn", "workid", "coinbase/append" ]}], + function(error, response){ + coin.jobManager.newTemplate(response.result); + console.log(coin.jobManager.currentJob.getJobParams()); + } + ); + }).on('startFailed', function(){ + console.log('Failed to start daemon for ' + coin.name); + }); + + + coin.stratumServer = new stratum.Server({ + port: 3333 + }); + coin.stratumServer.on('client', function(client){ + client.on('subscription', function(params, result){ + var extraNonce = coin.jobManager.extraNonceCounter.next(); + var extraNonce2Size = coinbase.extranonce_size - coin.jobManager.extraNonceCounter.size(); + result(extraNonce, extraNonce2Size); + client.sendDifficulty(1); + client.sendMiningJob(coin.jobManager.currentJob.getJobParams()); + }).on('authorize', function(params, result){ + result(true); + }).on('submit', function(params, result){ + + result(true); + }); + }); + + +}); + + + + +var blockNotifyServer = net.createServer(function(c) { + console.log('server connected'); + var data = ''; + c.on('data', function(d){ + console.log('got blocknotify data'); + data += d; + if (data.slice(-1) === '\n'){ + c.end(); + } + }); + c.on('end', function() { + console.log(data); + console.log('server disconnected'); + }); +}); +//blockNotifyServer.listen(8124, function() {}); + + + diff --git a/required-modules.txt b/required-modules.txt new file mode 100644 index 0000000..3820cab --- /dev/null +++ b/required-modules.txt @@ -0,0 +1,3 @@ +binpack https://github.com/russellmcc/node-binpack +bignum https://github.com/justmoon/node-bignum +base58-native https://github.com/gasteve/node-base58 \ No newline at end of file diff --git a/stratum.js b/stratum.js new file mode 100644 index 0000000..3b30b48 --- /dev/null +++ b/stratum.js @@ -0,0 +1,193 @@ +var net = require('net'); +var events = require('events'); + +var binpack = require('/usr/lib/node_modules/binpack'); + +var util = require('./util.js'); + + +var SubscriptionCounter = function(){ + var count = 0; + var padding = 'deadbeefdeadbeef'; + return { + next: function(){ + count++; + if (Number.MAX_VALUE == count) count = 0; + return padding + binpack.packUInt64(count, 'big').toString('hex'); + } + }; +}; + +var StratumClient = function(options){ + + //private members + + var _this = this; + + (function init(){ + setupSocket(); + })(); + + function handleMessage(message){ + switch(message.method){ + case 'mining.subscribe': + handleSubscribe(message); + break; + case 'mining.authorize': + handleAuthorize(message); + break; + case 'mining.submit': + handleSubmit(message); + break; + default: + console.dir('unknown stratum client message: ' + message); + break; + } + } + + function handleSubscribe(message){ + _this.emit('subscription', + {}, + function(extraNonce1, extraNonce2Size){ + _this.extraNonce = extraNonce1; + sendJson({ + id: message.id, + result: [ + ["mining.notify", options.subscriptionId], + extraNonce1, + extraNonce2Size + ], + error: null + }); + } + ); + } + + function handleAuthorize(message){ + _this.emit('authorize', + { + name: message.params[0][0], + password: message.params[0][1] + }, + function(authorized){ + sendJson({ + id: message.id, + result: authorized, + error: null + }); + } + ); + } + + function handleSubmit(message){ + _this.emit('submit', + { + name: message.params[0], + jobId: message.params[1], + extraNonce2: message.params[2], + nTime: message.params[3], + nonce: message.params[4] + }, + function(accepted){ + sendJson({ + id: message.id, + result: accepted, + error: null + }); + } + ); + } + + function sendJson(){ + var response = ''; + for (var i = 0; i < arguments.length; i++){ + response += JSON.stringify(arguments[i]) + '\n'; + } + console.log('response: ' + response); + options.socket.write(response); + } + + function setupSocket(){ + var socket = options.socket; + var dataBuffer = ''; + socket.setEncoding('utf8'); + socket.on('data', function(d){ + console.log('request: ' + d); + dataBuffer += d; + if (dataBuffer.slice(-1) === '\n'){ + var messages = dataBuffer.split('\n'); + messages.forEach(function(message){ + var messageJson; + try{ + messageJson = JSON.parse(message); + } + catch(e){ + console.log('could not parse stratum client socket message: ' + message); + } + if (messageJson) + handleMessage(messageJson); + }); + dataBuffer = ''; + } + }); + socket.on('end', function() { + _this.emit('socketDisconnect') + console.log('stratum client disconnected'); + }); + socket.on('error', function(){ + _this.emit('socketError'); + console.log('stratum client socket error'); + }); + } + + + //public members + + this.sendDifficulty = function(difficulty){ + sendJson({ + id: null, + method: "mining.set_difficulty", + params: [difficulty]//[512], + }); + }; + this.sendMiningJob = function(jobParams){ + sendJson({ + id: null, + method: "mining.notify", + params: jobParams + }); + }; +}; +StratumClient.prototype.__proto__ = events.EventEmitter.prototype; + + + +var StratumServer = exports.Server = function StratumServer(options){ + + //private members + + var _this = this; + var _socketServer; + var _stratumClients = {}; + var _subscriptionCounter = SubscriptionCounter(); + + (function init(){ + _socketServer = socketServer = net.createServer(function(c){ + var subscriptionId = _subscriptionCounter.next(); + var client = new StratumClient({subscriptionId: subscriptionId, socket: c}); + _stratumClients[subscriptionId] = client; + _this.emit('client', client); + }); + _socketServer.listen(options.port, function(){}); + })(); + + + //public members + + this.broadcastMiningJobs = function(jobParams){ + for (var clientId in _stratumClients){ + _stratumClients[clientId].sendMiningJob(jobParams) + } + }; +}; +StratumServer.prototype.__proto__ = events.EventEmitter.prototype; \ No newline at end of file diff --git a/templateRegistry.js b/templateRegistry.js new file mode 100644 index 0000000..58bece4 --- /dev/null +++ b/templateRegistry.js @@ -0,0 +1,3 @@ + + + diff --git a/util.js b/util.js new file mode 100644 index 0000000..b63f833 --- /dev/null +++ b/util.js @@ -0,0 +1,289 @@ +var crypto = require('crypto'); + +var binpack = require('/usr/lib/node_modules/binpack'); +var base58 = require('/usr/lib/node_modules/base58-native'); +var bignum = require('/usr/lib/node_modules/bignum'); + + +exports.bignumFromBits = function(bitsString){ + var bitsBuff = new Buffer(bitsString, 'hex'); + var numBytes = bitsBuff.readUInt8(0); + var bigBits = bignum.fromBuffer(bitsBuff.slice(1)); + var target = bigBits.mul( + bignum(2).pow( + bignum(8).mul( + numBytes - 3 + ) + ) + ); + return target; +}; + + +exports.bignumFromTarget = function(targetString){ + return bignum.fromBuffer(new Buffer(targetString, 'hex')); +}; + +exports.doublesha = function(buffer){ + var hash1 = crypto.createHash('sha256'); + hash1.update(buffer); + hash1 = hash1.digest(); + + var hash2 = crypto.createHash('sha256'); + hash2.update(hash1); + hash2 = hash2.digest(); + + return hash2; +}; + +exports.makeBufferReadable = function(buffer){ + var position = 0; + buffer.read = function(length){ + var section = buffer.slice(position, length ? (position + length) : buffer.length); + position += length; + return MakeBufferReadable(section); + } + return buffer; +}; + +exports.reverseBuffer = function(buff){ + var reversed = new Buffer(buff.length); + for (var i = 0; i < buff.length; i++){ + reversed[buff.length - (i + 1)] = buff[i]; + } + return reversed; +}; + +exports.reverseHex = function(hex){ + return exports.reverseBuffer(new Buffer(hex, 'hex')).toString('hex'); +}; + +exports.uint256BufferFromHash = function(hex){ + + var fromHex = new Buffer(hex, 'hex'); + + if (buffer.length != 32){ + var empty = new Buffer(32); + empty.fill(0); + fromHex.copy(empty); + fromHex = empty; + } + + return exports.reverseBuffer(fromHex); +}; + +exports.hexFromReversedBuffer = function(buffer){ + return exports.reverseBuffer(buffer).toString('hex'); +}; + + +exports.randomId = function(){ + var text = ""; + var possible = "abcdef0123456789"; + + for (var i = 0; i < 32; i++) + text += possible.charAt(Math.floor(Math.random() * possible.length)); + + return text; +}; + +exports.uint256_from_compact = function(c){ + var nbytes = (c >> 24) & 0xFF; + v = (c & 0xFFFFFF) << (8 * (nbytes - 3)) + return v; +}; + +exports.uint256_from_str = function(s){ + var r = 0; + var t = binpack.unpack +}; + +exports.ser_uint256_be = function(u){ + var rs = new Buffer(0); + exports.range(8).forEach(function(i){ + rs = Buffer.concat([ + rs, + binpack.packUInt32(u & 0xFFFFFFFF, 'big') + ]); + u >>= 32; + }); + return rs; +}; + + + +//use reversedbufferfromhex +/* +exports.ser_uint256 = function(u){ + var rs = new Buffer(0); + exports.range(8).forEach(function(i){ + rs = Buffer.concat([ + rs, + binpack.packUInt32(u & 0xFFFFFFFF, 'little') + ]); + u >>= 32; + }); + return rs; +}; +*/ + +//use hexfromrevsersedbuffer +/* +exports.deser_uint256 = function(f){ + var r = 0; + exports.range(8).forEach(function(i){ + var t = f.read(4).readUInt32LE(4); + r += t << (i * 32); + }); + return r; +}; +*/ + + +exports.serializeNumber = function(n){ + + if (n < 0xfd){ + var buff = new Buffer(2); + buff[0] = 0x1; + buff.writeUInt8(n, 1); + return buff; + } + else if (n <= 0xffff){ + var buff = new Buffer(4); + buff[0] = 0x3; + buff.writeUInt16BE(n, 1); + return buff; + } + else if (n <= 0xffffffff){ + var buff = new Buffer(6); + buff[0] = 0x5; + buff.writeUInt32BE(n, 1); + return buff; + } + else{ + return Buffer.concat([new Buffer([0x9]), binpack.packUInt64(n, 'little')]); + } + +}; + +exports.ser_string = function(s){ + + if (s.length < 253) + return Buffer.concat([ + new Buffer([s.length]), + new Buffer(s) + ]); + else if (s.length < 0x10000) + return Buffer.concat([ + new Buffer([253]), + binpack.packUInt16(s.length, 'little'), + new Buffer(s) + ]); + else if (s.length < 0x100000000) + return Buffer.concat([ + new Buffer([254]), + binpack.packUInt32(s.length, 'little'), + new Buffer(s) + ]); + else + return Buffer.concat([ + new Buffer([255]), + binpack.packUInt64(s.length), + new Buffer(s) + ]); +}; + +exports.deser_string = function(f){ + var nit = f.read(1).readUInt8(0); + if (nit == 253) + nit = f.read(2).readUInt16LE(0); + else if (nit == 254) + nit = f.read(4).readUInt32LE(1); + else if (nit == 255) + nit = f.read(8).readUInt64LE(1); + return f.read(nit); +}; + +exports.ser_vector = function(l){ + var r; + if (l.length < 253) + r = new Buffer([l.length]); + else if (l.length < 0x10000) + r = Buffer.concat([new Buffer([253]), binpack.packUInt16(l.length, 'little')]); + else if (l.length < 0x100000000) + r = Buffer.concat([new Buffer([254]), binpack.packUInt32(l.length, 'little')]); + else + r = Buffer.concat([new Buffer([255]), binpack.packUInt64(l.length, 'little')]); + + l.forEach(function(i){ + r = Buffer.concat([r, i.serialize()]); + }); + + return r; +}; + +exports.deser_vector = function(f, c){ + var nit = f.read(1).readUInt8(0); + if (nit == 253) + nit = f.read(2).readUInt16LE(0); + else if (nit == 254) + nit = f.read(4).readUInt32LE(0); + else if (nit == 255) + nit = f.read(8).readUInt64LE(0); + var r = []; + exports.range(nit).forEach(function(i){ + var t = new c(); + t.deserialize(f); + r.push(t); + }); + return r; +}; + +exports.range = function(start, stop, step){ + if (typeof stop == 'undefined'){ + stop = start; + start = 0; + } + if (typeof step == 'undefined'){ + step = 1; + } + if ((step > 0 && start >= stop) || (step < 0 && start <= stop)){ + return []; + } + var result = []; + for (var i = start; step > 0 ? i < stop : i > stop; i += step){ + result.push(i); + } + return result; +}; + +exports.address_to_pubkeyhash = function(addr){ + addr = base58.decode(addr); + + if (addr.length != 25){ + console.log('invalid address length for ' + addr); + throw 'invalid address length'; + } + + if (!addr) + return null; + + var ver = addr[0]; + var cksumA = addr.slice(-4); + var cksumB = exports.doublesha(addr.slice(0, -4)).slice(0, 4); + + if (cksumA.toString('hex') != cksumB.toString('hex')) + throw 'checksum did not match'; + + return [ver, addr.slice(1,-4)]; +}; + +exports.script_to_address = function(addr){ + var d = exports.address_to_pubkeyhash(addr) + if (!d) + throw "invalid address"; + + var ver = d[0]; + var pubkeyhash = d[1]; + return Buffer.concat([new Buffer([0x76, 0xa9, 0x14]), pubkeyhash, new Buffer([0x88, 0xac])]); +};