Created
July 12, 2017 19:28
-
-
Save sogoiii/aee03338132012245b888baddc8dff18 to your computer and use it in GitHub Desktop.
EtherAddressLookup analysis on their blacklist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const blacklist = require('./blacklist') | |
const levenshtein = require('fast-levenshtein') | |
const math = require('mathjs') | |
const comparison = 'myetherwallet' | |
const allScores = blacklist.map(item => { | |
return { | |
domain: item, | |
score: levenshtein.get(item.replace(/\./g,''), comparison) | |
} | |
}) | |
const scoreArr = allScores.map(item => item.score ) | |
const results = { | |
score: { | |
min: math.min(scoreArr), | |
max: math.max(scoreArr), | |
mean: math.mean(scoreArr), | |
median: math.median(scoreArr), | |
std: math.std(scoreArr) | |
} | |
} | |
console.log(JSON.stringify(results, null ,2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment