Compare commits
2 Commits
22d677d119
...
5c01d319f5
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c01d319f5 | |||
| a3b1b9473c |
@@ -74,6 +74,47 @@ 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 ""
|
||||||
|
|
||||||
|
def initcounters() -> None:
|
||||||
|
# 1. Initialize oacounter to 0
|
||||||
|
# 2. Set up a maxcounters variable to 293
|
||||||
|
# 3. Set up a percounter variable to int(total / maxcounters + 1)
|
||||||
|
# 4. Divides $total into sub-counters of size $pctr, stores this
|
||||||
|
# distribution in $noid, and prepares the structure to generate
|
||||||
|
# IDs in a balanced manner.
|
||||||
|
# - copy the value of total to the variable t
|
||||||
|
# - copy the value of percounter to pctr
|
||||||
|
# - initialize saclist as an empty string (list)
|
||||||
|
# - while t is more than zero
|
||||||
|
# - set up the top value for the counter
|
||||||
|
# `$t >= $pctr ? $pctr : $t`
|
||||||
|
# - set value of this counter to 0
|
||||||
|
# - add the counter to saclist
|
||||||
|
# - substract pctr from t
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import doctest
|
import doctest
|
||||||
|
|||||||
Reference in New Issue
Block a user