lib.krebs.genipv6 hash: 0000 -> 0 instead of ε

This commit is contained in:
tv 2018-12-11 19:52:12 +01:00
parent 172a746c3a
commit c36a52fb67

View File

@ -36,7 +36,7 @@ let {
suffixLength = addressLength - subnetPrefixLength;
};
hash = s: head (match "0*(.*)" (substring 0 4 (hashString "sha256" s)));
hash = s: head (match "0*(.+)" (substring 0 4 (hashString "sha256" s)));
dropLast = n: xs: reverseList (drop n (reverseList xs));
takeLast = n: xs: reverseList (take n (reverseList xs));