Skip to content

Instantly share code, notes, and snippets.

@tonymet
Last active April 9, 2019 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonymet/6dec6bd8acb816f946b823af1f780035 to your computer and use it in GitHub Desktop.
Save tonymet/6dec6bd8acb816f946b823af1f780035 to your computer and use it in GitHub Desktop.
package main
import (
"bufio"
"os"
)
func main() {
bufStdOut := bufio.NewWriterSize(os.Stdout, 1000)
defer bufStdOut.Flush()
file, err := os.Open(os.Args[1])
if err != nil {
panic(err)
}
defer file.Close()
words := make([]string, 0, 1000)
scanner := bufio.NewScanner(file)
for scanner.Scan() {
words = append(words, scanner.Text())
}
for _, a := range words {
for _, b := range words {
bufStdOut.WriteString(a + b + "\n" + a + " " + b + "\n")
}
}
}
#!/usr/bin/perl
while (<>) {
chop;
$w[$#w + 1] = $_;
}
foreach $a (@w) {
foreach $b (@w) {
print "$a$b\n";
print "$a $b\n";
}
}
time ./hasher 10-million-password-list-top-1000.txt > /dev/null
time perl hasher.pl 10-million-password-list-top-1000.txt > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment