diff --git a/bitaddress.org.html b/bitaddress.org.html index 02df0e8..bf1e5d7 100644 --- a/bitaddress.org.html +++ b/bitaddress.org.html @@ -1,8 +1,30 @@ + + bitaddress.org @@ -669,10 +691,8 @@ * Ported loosely from BouncyCastle's Java EC code * Only Fp curves implemented for now * - * Copyright Tom Wu. BSD License. + * Copyright Tom Wu, bitaddress.org BSD License. * http://www-cs-students.stanford.edu/~tjw/jsbn/LICENSE - * - * Copyright bitaddress.org */ (function () { @@ -1166,7 +1186,7 @@ * * Copyright (c) 2005 Tom Wu * All Rights Reserved. - * See "LICENSE" for details. + * BSD License * http://www-cs-students.stanford.edu/~tjw/jsbn/LICENSE * * Copyright Stephan Thomas @@ -2377,29 +2397,6 @@ //--------------------------------------------------------------------- (function () { - //--------------------------------------------------------------------- - // QR8bitByte - //--------------------------------------------------------------------- - - function QR8bitByte(data) { - this.mode = QRCode.Mode.MODE_8BIT_BYTE; - this.data = data; - } - - QR8bitByte.prototype = { - - getLength: function (buffer) { - return this.data.length; - }, - - write: function (buffer) { - for (var i = 0; i < this.data.length; i++) { - // not JIS ... - buffer.put(this.data.charCodeAt(i), 8); - } - } - }; - //--------------------------------------------------------------------- // QRCode //--------------------------------------------------------------------- @@ -2416,7 +2413,7 @@ QRCode.prototype = { addData: function (data) { - var newData = new QR8bitByte(data); + var newData = new QRCode.QR8bitByte(data); this.dataList.push(newData); this.dataCache = null; }, @@ -2498,7 +2495,7 @@ this.makeImpl(true, i); - var lostPoint = QRUtil.getLostPoint(this); + var lostPoint = QRCode.Util.getLostPoint(this); if (i == 0 || minLostPoint > lostPoint) { minLostPoint = lostPoint; @@ -2558,7 +2555,7 @@ setupPositionAdjustPattern: function () { - var pos = QRUtil.getPatternPosition(this.typeNumber); + var pos = QRCode.Util.getPatternPosition(this.typeNumber); for (var i = 0; i < pos.length; i++) { @@ -2589,7 +2586,7 @@ setupTypeNumber: function (test) { - var bits = QRUtil.getBCHTypeNumber(this.typeNumber); + var bits = QRCode.Util.getBCHTypeNumber(this.typeNumber); for (var i = 0; i < 18; i++) { var mod = (!test && ((bits >> i) & 1) == 1); @@ -2605,7 +2602,7 @@ setupTypeInfo: function (test, maskPattern) { var data = (this.errorCorrectLevel << 3) | maskPattern; - var bits = QRUtil.getBCHTypeInfo(data); + var bits = QRCode.Util.getBCHTypeInfo(data); // vertical for (var i = 0; i < 15; i++) { @@ -2663,7 +2660,7 @@ dark = (((data[byteIndex] >>> bitIndex) & 1) == 1); } - var mask = QRUtil.getMask(maskPattern, row, col - c); + var mask = QRCode.Util.getMask(maskPattern, row, col - c); if (mask) { dark = !dark; @@ -2698,14 +2695,14 @@ QRCode.createData = function (typeNumber, errorCorrectLevel, dataList) { - var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel); + var rsBlocks = QRCode.RSBlock.getRSBlocks(typeNumber, errorCorrectLevel); - var buffer = new QRBitBuffer(); + var buffer = new QRCode.BitBuffer(); for (var i = 0; i < dataList.length; i++) { var data = dataList[i]; buffer.put(data.mode, 4); - buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber)); + buffer.put(data.getLength(), QRCode.Util.getLengthInBits(data.mode, typeNumber)); data.write(buffer); } @@ -2775,8 +2772,8 @@ } offset += dcCount; - var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount); - var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1); + var rsPoly = QRCode.Util.getErrorCorrectPolynomial(ecCount); + var rawPoly = new QRCode.Polynomial(dcdata[r], rsPoly.getLength() - 1); var modPoly = rawPoly.mod(rsPoly); ecdata[r] = new Array(rsPoly.getLength() - 1); @@ -2815,6 +2812,27 @@ }; + //--------------------------------------------------------------------- + // QR8bitByte + //--------------------------------------------------------------------- + QRCode.QR8bitByte = function (data) { + this.mode = QRCode.Mode.MODE_8BIT_BYTE; + this.data = data; + } + + QRCode.QR8bitByte.prototype = { + getLength: function (buffer) { + return this.data.length; + }, + + write: function (buffer) { + for (var i = 0; i < this.data.length; i++) { + // not JIS ... + buffer.put(this.data.charCodeAt(i), 8); + } + } + }; + //--------------------------------------------------------------------- // QRMode @@ -2855,7 +2873,7 @@ // QRUtil //--------------------------------------------------------------------- - var QRUtil = { + QRCode.Util = { PATTERN_POSITION_TABLE: [ [], @@ -2906,16 +2924,16 @@ getBCHTypeInfo: function (data) { var d = data << 10; - while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) { - d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15))); + while (QRCode.Util.getBCHDigit(d) - QRCode.Util.getBCHDigit(QRCode.Util.G15) >= 0) { + d ^= (QRCode.Util.G15 << (QRCode.Util.getBCHDigit(d) - QRCode.Util.getBCHDigit(QRCode.Util.G15))); } - return ((data << 10) | d) ^ QRUtil.G15_MASK; + return ((data << 10) | d) ^ QRCode.Util.G15_MASK; }, getBCHTypeNumber: function (data) { var d = data << 12; - while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) { - d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18))); + while (QRCode.Util.getBCHDigit(d) - QRCode.Util.getBCHDigit(QRCode.Util.G18) >= 0) { + d ^= (QRCode.Util.G18 << (QRCode.Util.getBCHDigit(d) - QRCode.Util.getBCHDigit(QRCode.Util.G18))); } return (data << 12) | d; }, @@ -2933,7 +2951,7 @@ }, getPatternPosition: function (typeNumber) { - return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1]; + return QRCode.Util.PATTERN_POSITION_TABLE[typeNumber - 1]; }, getMask: function (maskPattern, i, j) { @@ -2956,10 +2974,10 @@ getErrorCorrectPolynomial: function (errorCorrectLength) { - var a = new QRPolynomial([1], 0); + var a = new QRCode.Polynomial([1], 0); for (var i = 0; i < errorCorrectLength; i++) { - a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0)); + a = a.multiply(new QRCode.Polynomial([1, QRCode.Math.gexp(i)], 0)); } return a; @@ -3124,7 +3142,7 @@ // QRMath //--------------------------------------------------------------------- - var QRMath = { + QRCode.Math = { glog: function (n) { @@ -3132,7 +3150,7 @@ throw new Error("glog(" + n + ")"); } - return QRMath.LOG_TABLE[n]; + return QRCode.Math.LOG_TABLE[n]; }, gexp: function (n) { @@ -3145,7 +3163,7 @@ n -= 255; } - return QRMath.EXP_TABLE[n]; + return QRCode.Math.EXP_TABLE[n]; }, EXP_TABLE: new Array(256), @@ -3155,23 +3173,23 @@ }; for (var i = 0; i < 8; i++) { - QRMath.EXP_TABLE[i] = 1 << i; + QRCode.Math.EXP_TABLE[i] = 1 << i; } for (var i = 8; i < 256; i++) { - QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] - ^ QRMath.EXP_TABLE[i - 5] - ^ QRMath.EXP_TABLE[i - 6] - ^ QRMath.EXP_TABLE[i - 8]; + QRCode.Math.EXP_TABLE[i] = QRCode.Math.EXP_TABLE[i - 4] + ^ QRCode.Math.EXP_TABLE[i - 5] + ^ QRCode.Math.EXP_TABLE[i - 6] + ^ QRCode.Math.EXP_TABLE[i - 8]; } for (var i = 0; i < 255; i++) { - QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i; + QRCode.Math.LOG_TABLE[QRCode.Math.EXP_TABLE[i]] = i; } //--------------------------------------------------------------------- // QRPolynomial //--------------------------------------------------------------------- - function QRPolynomial(num, shift) { + QRCode.Polynomial = function (num, shift) { if (num.length == undefined) { throw new Error(num.length + "/" + shift); @@ -3189,7 +3207,7 @@ } } - QRPolynomial.prototype = { + QRCode.Polynomial.prototype = { get: function (index) { return this.num[index]; @@ -3205,11 +3223,11 @@ for (var i = 0; i < this.getLength(); i++) { for (var j = 0; j < e.getLength(); j++) { - num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j))); + num[i + j] ^= QRCode.Math.gexp(QRCode.Math.glog(this.get(i)) + QRCode.Math.glog(e.get(j))); } } - return new QRPolynomial(num, 0); + return new QRCode.Polynomial(num, 0); }, mod: function (e) { @@ -3218,7 +3236,7 @@ return this; } - var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)); + var ratio = QRCode.Math.glog(this.get(0)) - QRCode.Math.glog(e.get(0)); var num = new Array(this.getLength()); @@ -3227,11 +3245,11 @@ } for (var i = 0; i < e.getLength(); i++) { - num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio); + num[i] ^= QRCode.Math.gexp(QRCode.Math.glog(e.get(i)) + ratio); } // recursive call - return new QRPolynomial(num, 0).mod(e); + return new QRCode.Polynomial(num, 0).mod(e); } }; @@ -3239,12 +3257,12 @@ // QRRSBlock //--------------------------------------------------------------------- - function QRRSBlock(totalCount, dataCount) { + QRCode.RSBlock = function (totalCount, dataCount) { this.totalCount = totalCount; this.dataCount = dataCount; } - QRRSBlock.RS_BLOCK_TABLE = [ + QRCode.RSBlock.RS_BLOCK_TABLE = [ // L // M @@ -3313,9 +3331,9 @@ ]; - QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) { + QRCode.RSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) { - var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel); + var rsBlock = QRCode.RSBlock.getRsBlockTable(typeNumber, errorCorrectLevel); if (rsBlock == undefined) { throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel); @@ -3332,24 +3350,24 @@ var dataCount = rsBlock[i * 3 + 2]; for (var j = 0; j < count; j++) { - list.push(new QRRSBlock(totalCount, dataCount)); + list.push(new QRCode.RSBlock(totalCount, dataCount)); } } return list; }; - QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) { + QRCode.RSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) { switch (errorCorrectLevel) { case QRCode.ErrorCorrectLevel.L: - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0]; + return QRCode.RSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0]; case QRCode.ErrorCorrectLevel.M: - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1]; + return QRCode.RSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1]; case QRCode.ErrorCorrectLevel.Q: - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2]; + return QRCode.RSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2]; case QRCode.ErrorCorrectLevel.H: - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3]; + return QRCode.RSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3]; default: return undefined; } @@ -3359,12 +3377,12 @@ // QRBitBuffer //--------------------------------------------------------------------- - function QRBitBuffer() { + QRCode.BitBuffer = function () { this.buffer = new Array(); this.length = 0; } - QRBitBuffer.prototype = { + QRCode.BitBuffer.prototype = { get: function (index) { var bufIndex = Math.floor(index / 8); @@ -3818,49 +3836,54 @@ - -
- bitaddress.org + +
+ -
+ +
+
+ + +
+ +
+ Addresses per page: + Addresses to generate: + + +
+ +
+ Start index: + Rows to generate: + + +
+
+ +
Generating Bitcoin Address...
@@ -3895,14 +3943,14 @@
-
+
Bitcoin Address:
-
+
Private Key (Wallet Import Format): @@ -3910,27 +3958,17 @@
+ +
+
Comma Separated Values: Index,Bitcoin Address,Private Key
+ -
-
- - -
- -
- Start index: - Rows to generate: - - -
-
- -