Improve old browsers support
This commit is contained in:
parent
6478be07d7
commit
7633e5c6ac
5 changed files with 3253 additions and 459 deletions
|
@ -31,7 +31,7 @@ gulp.task('sass', cb => {
|
||||||
gulp.task('build-js', ['browserify'], cb => {
|
gulp.task('build-js', ['browserify'], cb => {
|
||||||
pump([
|
pump([
|
||||||
gulp.src('js/bundle.js'),
|
gulp.src('js/bundle.js'),
|
||||||
babel({presets: ['env']}),
|
babel({presets: ['env'], plugins: ['@babel/plugin-transform-object-assign']}),
|
||||||
uglify(),
|
uglify(),
|
||||||
gulp.dest('js')
|
gulp.dest('js')
|
||||||
], cb);
|
], cb);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -6,14 +6,16 @@
|
||||||
* @param hex
|
* @param hex
|
||||||
* @returns {boolean}
|
* @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);
|
const ret = Math.pow(16, pattern.length);
|
||||||
return isChecksum ? (ret * Math.pow(2, pattern.replace(/[^a-f]/gi, '').length)) : ret;
|
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);
|
return 1 - Math.pow((difficulty - 1) / difficulty, attempts);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
3693
package-lock.json
generated
3693
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -3,6 +3,7 @@
|
||||||
"description": "Online ETH vanity address generator",
|
"description": "Online ETH vanity address generator",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@babel/plugin-transform-object-assign": "^7.0.0-beta.37",
|
||||||
"babel-preset-env": "^1.6.1",
|
"babel-preset-env": "^1.6.1",
|
||||||
"browserify": "^14.5.0",
|
"browserify": "^14.5.0",
|
||||||
"ethereumjs-util": "^5.1.2",
|
"ethereumjs-util": "^5.1.2",
|
||||||
|
|
Loading…
Add table
Reference in a new issue