Skip to content

Commit

Permalink
terser more efficient versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Schonrock committed Oct 23, 2024
1 parent 26c6351 commit 0405df1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fetch_hibp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
cd data
curl --retry 10 --retry-all-errors --remote-name-all --parallel --parallel-max 150 "https://api.pwnedpasswords.com/range/{0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}{0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}{0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}{0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}{0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}" > curl.log 2>&1

find . -type f -print | egrep -ia '/[0-9a-f]{5}$' | xargs -r -d '\n' awk -F: '{ sub(/\r$/,""); print substr(FILENAME, length(FILENAME)-4, 5) $1 ":" $2 }' > hibp_all.txt

find . -type f -print | egrep -ia '/[0-9a-f]{5}$' | xargs -r -d '\n' rm
find . -type f -printf '%f\n' | egrep -ia '^[0-9a-f]{5}$' | xargs awk -F: '{ print FILENAME $1 ":" $2 }' | tr -d '\r' > hibp_all.txt

find . -type f -print | egrep -ia '/[0-9a-f]{5}$' | xargs rm

0 comments on commit 0405df1

Please sign in to comment.