Improve old browsers support

This commit is contained in:
Boris Kubiak 2018-01-08 19:43:20 +01:00
parent 6478be07d7
commit 7633e5c6ac
5 changed files with 3253 additions and 459 deletions

View file

@ -31,7 +31,7 @@ gulp.task('sass', cb => {
gulp.task('build-js', ['browserify'], cb => {
pump([
gulp.src('js/bundle.js'),
babel({presets: ['env']}),
babel({presets: ['env'], plugins: ['@babel/plugin-transform-object-assign']}),
uglify(),
gulp.dest('js')
], cb);

File diff suppressed because one or more lines are too long

View file

@ -6,14 +6,16 @@
* @param hex
* @returns {boolean}
*/
const isValidHex = hex => hex.length ? /^[0-9A-F]+$/g.test(hex.toUpperCase()) : true;
const isValidHex = function (hex) {
return hex.length ? /^[0-9A-F]+$/g.test(hex.toUpperCase()) : true;
};
const computeDifficulty = (pattern, isChecksum) => {
const computeDifficulty = function (pattern, isChecksum) {
const ret = Math.pow(16, pattern.length);
return isChecksum ? (ret * Math.pow(2, pattern.replace(/[^a-f]/gi, '').length)) : ret;
};
const computeProbability = (difficulty, attempts) => {
const computeProbability = function (difficulty, attempts) {
return 1 - Math.pow((difficulty - 1) / difficulty, attempts);
};
@ -78,7 +80,7 @@ new Vue({
},
/**
* Create missing workers, remove the unwanted ones.
* Create missing workers, remove the unwanted ones.
*/
initWorkers() {
const self = this;
@ -86,7 +88,7 @@ new Vue({
return;
}
// Remove unwanted workers
// Remove unwanted workers
if (this.workers.length > this.threads) {
for (let w = this.threads - 1; w < this.workers.length; w++) {
this.workers[w].terminate();
@ -95,7 +97,7 @@ new Vue({
return;
}
// Create workers
// Create workers
for (let w = this.workers.length; w < this.threads; w++) {
try {
this.workers[w] = new Worker('js/bundle.js');

3693
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -3,6 +3,7 @@
"description": "Online ETH vanity address generator",
"version": "1.0.0",
"dependencies": {
"@babel/plugin-transform-object-assign": "^7.0.0-beta.37",
"babel-preset-env": "^1.6.1",
"browserify": "^14.5.0",
"ethereumjs-util": "^5.1.2",