All 0.28.0 Changes - Bitnodes 4 and 11 and webpack migration

This commit is contained in:
danielyxie
2017-08-30 12:44:29 -05:00
parent 33c10ccc64
commit 7a05d3585a
50 changed files with 47063 additions and 1738 deletions
+8 -5
View File
@@ -10,13 +10,13 @@ function sizeOfObject(obj) {
}
//Adds a random offset to a number within a certain percentage
//e.g. addOffset(100, 5) will return anything from 95 to 105.
//e.g. addOffset(100, 5) will return anything from 95 to 105.
//The percentage argument must be between 0 and 100;
function addOffset(n, percentage) {
if (percentage < 0 || percentage > 100) {return;}
var offset = n * (percentage / 100);
return n + ((Math.random() * (2 * offset)) - offset);
}
@@ -41,7 +41,7 @@ function compareArrays(a1, a2) {
if (a1.length != a2.length) {
return false;
}
for (var i = 0; i < a1.length; ++i) {
if (a1[i] != a2[i]) {return false;}
}
@@ -56,4 +56,7 @@ function printArray(a) {
function powerOfTwo(n) {
if (isNaN(n)) {return false;}
return n && (n & (n-1)) === 0;
}
}
export {sizeOfObject, addOffset, clearEventListeners, getRandomInt,
compareArrays, printArray, powerOfTwo};