3 chrs = lib.listToAttrs (lib.imap (i: v: { name = v; value = i + 96; }) lib.lowerChars);
4 ord = c: builtins.getAttr c chrs;
7 # Make a unique UID from a 4-char identifier
10 chars = lib.stringToCharacters (builtins.substring 0 4 id);
11 n = builtins.map (c: lib.mod (ord c) 10) chars;
12 s = builtins.concatStringsSep "" (builtins.map (i: builtins.toString i) n);
14 assert builtins.stringLength id >= 4;
15 assert builtins.length chars == 4;