Adding a description of the algorithm used in Noid.pm

This commit is contained in:
2026-07-17 08:55:10 +02:00
parent e971ac700f
commit c4fdb3a0d3
+12
View File
@@ -170,6 +170,18 @@ class Minter(Persistent):
return s
def _checkchar(self, id):
# 1. Return undef if id is not set
# 2. init lastchar to last char of the id, and remove that char from id
# 3. init pos to 1
# 4. init sum to 0
# 5. declare c
# 6. for each character of the id
# - get the ordinal value of the character
# - increment sum with the pos * the index value of the char in legalstring
# - increment pos
# 7. init checkchar to the value of xdig[sum % alphacount]
# 8. return the concat of id and checkchar is lastchar equal to '+' or checkchar
# 9. return None
pass