From 12cf076118570eebbff08c6b3090e0d4798447a1 Mon Sep 17 00:00:00 2001 From: cyfraeviolae Date: Wed, 3 Apr 2024 03:17:55 -0400 Subject: no venv --- .../faker/providers/ssn/zh_TW/__init__.py | 45 --------------------- .../ssn/zh_TW/__pycache__/__init__.cpython-311.pyc | Bin 2913 -> 0 bytes 2 files changed, 45 deletions(-) delete mode 100644 venv/lib/python3.11/site-packages/faker/providers/ssn/zh_TW/__init__.py delete mode 100644 venv/lib/python3.11/site-packages/faker/providers/ssn/zh_TW/__pycache__/__init__.cpython-311.pyc (limited to 'venv/lib/python3.11/site-packages/faker/providers/ssn/zh_TW') 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 deleted file mode 100644 index 14ebd53..0000000 Binary files a/venv/lib/python3.11/site-packages/faker/providers/ssn/zh_TW/__pycache__/__init__.cpython-311.pyc and /dev/null differ -- cgit v1.2.3