First working implementation of _n2xdig method

This commit is contained in:
2026-07-15 21:09:02 +02:00
parent ff678d71d1
commit f702f99b3b
+32 -1
View File
@@ -123,7 +123,38 @@ class Minter(Persistent):
# - s = self.legalstring[remainder] + s # - s = self.legalstring[remainder] + s
# 7. if mask contains a 'k' then add a '+' at the end of s # 7. if mask contains a 'k' then add a '+' at the end of s
# 8. return s # 8. return s
return "" s = ""
varwidth = 0
xdig = list(self.legalstring)
rmask = list(self.template)
rmask.reverse()
while num != 0 or not varwidth:
if not varwidth:
try:
c = rmask.pop(0)
except IndexError:
print(self)
break
match c:
case "r":
break
case "s":
break
case "e":
div = self.alphacount
case "d":
div = self.digitcount
case "z":
varwidth = 1
continue
case "k":
continue
remainder = num % div
num = int(num / div)
s = xdig[remainder] + s
if self.template[-1] == "k":
s += "+"
return s
def _checkbar(self, id): def _checkbar(self, id):
pass pass