diff options
author | cyfraeviolae <cyfraeviolae> | 2024-04-03 03:17:55 -0400 |
---|---|---|
committer | cyfraeviolae <cyfraeviolae> | 2024-04-03 03:17:55 -0400 |
commit | 12cf076118570eebbff08c6b3090e0d4798447a1 (patch) | |
tree | 3ba25e17e3c3a5e82316558ba3864b955919ff72 /venv/lib/python3.11/site-packages/faker/providers/ssn/zh_TW | |
parent | c45662ff3923b34614ddcc8feb9195541166dcc5 (diff) |
no venv
Diffstat (limited to 'venv/lib/python3.11/site-packages/faker/providers/ssn/zh_TW')
2 files changed, 0 insertions, 45 deletions
diff --git a/venv/lib/python3.11/site-packages/faker/providers/ssn/zh_TW/__init__.py b/venv/lib/python3.11/site-packages/faker/providers/ssn/zh_TW/__init__.py deleted file mode 100644 index 1b56527..0000000 --- a/venv/lib/python3.11/site-packages/faker/providers/ssn/zh_TW/__init__.py +++ /dev/null @@ -1,45 +0,0 @@ -from .. import Provider as SsnProvider - - -def checksum(s: str) -> int: - def _get_alphabet_weight(c: str) -> int: - """A=10, B=11, ...., H=17, - I=34, - J=18, K=19, ..., N=22, - O=35, - P=23, Q=24, ..., V=29, - W=32, - X=30, Y=31, Z=33 - """ - if ord(c) < 73: # A-H - return ord(c) - 55 - if ord(c) == 73: # I - return ord(c) - 39 - if ord(c) < 79: # J-N - return ord(c) - 56 - if ord(c) == 79: # O - return ord(c) - 44 - if ord(c) < 87: # P-V - return ord(c) - 57 - if ord(c) == 87: # W - return ord(c) - 55 - if ord(c) < 90: # X, Y - return ord(c) - 58 - return ord(c) - 57 # Z - - res = 0 - for i, c in enumerate(s): - if i == 0: - res = _get_alphabet_weight(c) % 10 * 9 + _get_alphabet_weight(c) // 10 - elif i < 9: - res += int(c) * (9 - i) - else: - res += int(c) - return res - - -class Provider(SsnProvider): - def ssn(self) -> str: - ssn_without_last_char = self.numerify(self.random_uppercase_letter() + str(self.random_int(1, 2)) + "#######") - last_char = str((10 - checksum(ssn_without_last_char) % 10) % 10) - return ssn_without_last_char + last_char diff --git a/venv/lib/python3.11/site-packages/faker/providers/ssn/zh_TW/__pycache__/__init__.cpython-311.pyc b/venv/lib/python3.11/site-packages/faker/providers/ssn/zh_TW/__pycache__/__init__.cpython-311.pyc Binary files differdeleted file mode 100644 index 14ebd53..0000000 --- a/venv/lib/python3.11/site-packages/faker/providers/ssn/zh_TW/__pycache__/__init__.cpython-311.pyc +++ /dev/null |