From 80efda89dabe7850000d1b0396e9a708c7f70e7c Mon Sep 17 00:00:00 2001 From: Emmanuel Di Pretoro Date: Fri, 10 Jul 2026 14:37:49 +0200 Subject: [PATCH] Adding the pseudocode of the _n2xdig method --- noid.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/noid.py b/noid.py index 5f45dd2..33fb809 100644 --- a/noid.py +++ b/noid.py @@ -97,6 +97,28 @@ class Minter(): self.active_counters.append(c) t -= self.percounter + def _n2xdig(self, num) -> str: + # 1. Initialize s to '' + # 2. Déclare div, remainder and c + # 3. Confirm well-formedness of mask + # 4. Initialize varwidth to 0, the fixed width part of the mask + # 5. Initialize rmask (reverse mask) + # 6. While n != 0 OR not varwidth + # - if not varwidth + # - take a character from the rmask + # - if c is not defined or c is r or s + # - end the loop + # - if c is equal to e then div is equal to alphacount + # - if c is equal to d then div is equal to digitcount + # - if c is equal to z then varwidth become 1 and we keep the same div value + # - if c is equal to k then we keep the same div value + # - remainder <- num %div + # - num <- int(num / div) + # - s = self.legalstring[remainder] + s + # 7. if mask contains a 'k' then add a '+' at the end of s + # 8. return s + return "" + if __name__ == "__main__": pass