Adding a stub for the genid method and the pseudocode for it

This commit is contained in:
2026-07-09 15:33:46 +02:00
parent 22d677d119
commit a3b1b9473c
+22
View File
@@ -74,6 +74,28 @@ class Minter():
self.oatop *= self.digitcount self.oatop *= self.digitcount
return self.oatop return self.oatop
def genid(self) -> str:
# 1. Check if the oacounter >= oatop
# -> noid are exhausted
# -> At this time, all our noid are considered as longterm
# -> At this tile, all our noid are not sequential, thus random
# 2. Get the size of saclist (active counters list)
# 3. if that size is less than 1 then no more active counters then no noid
# 4. pick at random an active counter
# - rand → int (index to use)
# 5. get its value
# 6. increment its value
# 7. increment oacounter
# 8. deal with an exhausted subcounter
# - if new value is more more or equal to the top value of this counter
# - remove this counter from the saclist
# - add this counter to the siclist
# 9. Generate the noid with a call to n2xdig()
# - Arguments
# - value + (index * percounter)
# - mask
# 10. return the noid
return ""
if __name__ == "__main__": if __name__ == "__main__":
import doctest import doctest