Adding a description of the algorithm used in Noid.pm
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user