From 4a0c92e3515870e48499c88beb5f6a5b224d1f1c Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Wed, 17 Dec 2025 10:53:17 -0700 Subject: [PATCH] 1765993998 --- customscripts/hibp-download-parser.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 customscripts/hibp-download-parser.sh diff --git a/customscripts/hibp-download-parser.sh b/customscripts/hibp-download-parser.sh new file mode 100644 index 0000000..72ca494 --- /dev/null +++ b/customscripts/hibp-download-parser.sh @@ -0,0 +1,22 @@ +#!/bin/bash +max=65535 # FFFF +txtfile="/mnt/e/2025-12-17_hibp_sha1.txt" +outdir="/mnt/e/hibp_parsed" + +if [ ! -d "$outdir" ]; then + echo "creating $outdir" + mkdir "$outdir" +else + echo "clearing $outdir" + rm -f "$outdir/*" +fi + +# remove the carriage returns from file +# sed -i "s/\x0d//g" "$txtfile" + +for ((i = 0; i <= $max; i++)); do + HEX_VAL=$(printf "%04X" $i) # %04X to give padding 0s up to four + echo "$HEX_VAL" + rg -N "^$HEX_VAL" "$txtfile" >> "$outdir/$HEX_VAL.txt" + echo $? +done \ No newline at end of file