summaryrefslogtreecommitdiffstats
path: root/krebs/3modules
diff options
context:
space:
mode:
authorlassulus <lassulus@lassul.us>2021-04-30 11:29:24 +0200
committermakefu <github@syntax-fehler.de>2021-05-15 13:11:34 +0200
commit4f638ddb3da099e02ef8c5444026f0e71e553741 (patch)
tree5690ae11831dc47e29c8623879ed7f75b3abdc95 /krebs/3modules
parent329d01a7bfc592edaf790e40b3a58d4ffac982b8 (diff)
go: use last 5 hash characters for short urls
Diffstat (limited to 'krebs/3modules')
-rw-r--r--krebs/3modules/go.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/krebs/3modules/go.nix b/krebs/3modules/go.nix
index 5686fea3f..fea25e036 100644
--- a/krebs/3modules/go.nix
+++ b/krebs/3modules/go.nix
@@ -51,7 +51,7 @@ let
sha256=$(echo "$uri" | sha256sum -b | cut -d\ -f1)
base32=$(${pkgs.nixStable}/bin/nix-hash --to-base32 --type sha256 "$sha256")
- base32short=$(echo "$base32" | cut -b-5)
+ base32short=$(echo "$base32" | cut -c48-52)
${pkgs.redis}/bin/redis-cli set "$base32short" "$uri" >/dev/null
ref="http://$req_host/$base32short"