Skip to content

Commit

Permalink
Urls can’t be converted to lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
osvik committed Oct 21, 2017
1 parent 8b404e1 commit 8365ce4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ecounter.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,27 @@ func main() {
fileToHandle := fileToString(*inputFile)

var allMatches []string
var allMatchesLC []string
var uniques []string

switch *countIt {
case "emails":
allMatches = searchInString(fileToHandle, emailRegex)
allMatchesLC = arrayToLowercase(allMatches)
uniques = uniquesInArray(allMatchesLC)
case "sha256":
allMatches = searchInString(fileToHandle, shaRegex)
allMatchesLC = arrayToLowercase(allMatches)
uniques = uniquesInArray(allMatchesLC)
case "urls":
allMatches = searchInString(fileToHandle, urlsRegex)
uniques = uniquesInArray(allMatches)
default:
allMatches = searchInString(fileToHandle, emailRegex)
allMatchesLC = arrayToLowercase(allMatches)
uniques = uniquesInArray(allMatchesLC)
}

allMatchesLC := arrayToLowercase(allMatches)
uniques := uniquesInArray(allMatchesLC)

if *encrypt == true {
uniques = arrayToSha256(uniques)
}
Expand Down

0 comments on commit 8365ce4

Please sign in to comment.