From 4f638ddb3da099e02ef8c5444026f0e71e553741 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 30 Apr 2021 11:29:24 +0200 Subject: go: use last 5 hash characters for short urls --- krebs/3modules/go.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'krebs') 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" -- cgit v1.2.3