diff --git a/js/coin.js b/js/coin.js index a19ecef..2b2f883 100644 --- a/js/coin.js +++ b/js/coin.js @@ -60,6 +60,12 @@ for(i=0;i<(x).length/25;i++){ r = Crypto.SHA256(r.concat(x)); } + var checkrBigInt = new BigInteger(r); + var orderBigInt = new BigInteger("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"); + while (checkrBigInt.compareTo(orderBigInt) >= 0 || checkrBigInt.equals(BigInteger.ZERO) || checkrBigInt.equals(BigInteger.ONE)) { + r = Crypto.SHA256(r.concat(x)); + checkrBigInt = new BigInteger(r); + } return r; } diff --git a/js/coinbin.js b/js/coinbin.js index f39389e..84514d8 100644 --- a/js/coinbin.js +++ b/js/coinbin.js @@ -830,8 +830,8 @@ $(document).ready(function() { }; if (tempX < 0){tempX = 0}; if (tempY < 0){tempY = 0}; - var xEnt = Crypto.util.bytesToHex([tempX]); - var yEnt = Crypto.util.bytesToHex([tempY]); + var xEnt = Crypto.util.bytesToHex([tempX]).slice(-2); + var yEnt = Crypto.util.bytesToHex([tempY]).slice(-2); var addEnt = xEnt.concat(yEnt); if ($("#entropybucket").html().indexOf(xEnt) == -1 && $("#entropybucket").html().indexOf(yEnt) == -1) { $("#entropybucket").html(addEnt + $("#entropybucket").html());