It was implemented using Bruce Schneier's excellent book "Applied Cryptography", 2nd ed., 1996. Surely this is not meant to compete with the existing implementation of the Python standard library ...
// Time: O(n log(maxVal)), Space: O(n) — chain length per key is at most log(maxVal) ...