diff options
author | lassulus <lassulus@lassul.us> | 2021-04-30 11:29:24 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2021-04-30 11:29:24 +0200 |
commit | a9da6e0e5bc2e9d4b5141de39942f77e546a425f (patch) | |
tree | 1db66f27d6ccb7e365c862f6f5b83dfd3ec21762 /krebs/3modules | |
parent | 0f21f4250a7e5037cc0cf9a0416857e7da16d30a (diff) |
go: use last 5 hash characters for short urls
Diffstat (limited to 'krebs/3modules')
-rw-r--r-- | krebs/3modules/go.nix | 2 |
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" |