summaryrefslogtreecommitdiff
path: root/venv/lib/python3.11/site-packages/faker/providers/company/fr_CH
diff options
context:
space:
mode:
authorcyfraeviolae <cyfraeviolae>2024-04-03 03:17:55 -0400
committercyfraeviolae <cyfraeviolae>2024-04-03 03:17:55 -0400
commit12cf076118570eebbff08c6b3090e0d4798447a1 (patch)
tree3ba25e17e3c3a5e82316558ba3864b955919ff72 /venv/lib/python3.11/site-packages/faker/providers/company/fr_CH
parentc45662ff3923b34614ddcc8feb9195541166dcc5 (diff)
no venv
Diffstat (limited to 'venv/lib/python3.11/site-packages/faker/providers/company/fr_CH')
-rw-r--r--venv/lib/python3.11/site-packages/faker/providers/company/fr_CH/__init__.py40
-rw-r--r--venv/lib/python3.11/site-packages/faker/providers/company/fr_CH/__pycache__/__init__.cpython-311.pycbin2262 -> 0 bytes
2 files changed, 0 insertions, 40 deletions
diff --git a/venv/lib/python3.11/site-packages/faker/providers/company/fr_CH/__init__.py b/venv/lib/python3.11/site-packages/faker/providers/company/fr_CH/__init__.py
deleted file mode 100644
index 35d3a8f..0000000
--- a/venv/lib/python3.11/site-packages/faker/providers/company/fr_CH/__init__.py
+++ /dev/null
@@ -1,40 +0,0 @@
-from typing import List
-
-from ..fr_FR import Provider as CompanyProvider
-
-
-class Provider(CompanyProvider):
- company_suffixes = ("SA", "Sàrl.")
-
- def ide(self) -> str:
- """
- Generates a IDE number (9 digits).
- http://www.bfs.admin.ch/bfs/portal/fr/index/themen/00/05/blank/03/02.html
- """
-
- def _checksum(digits: List[int]) -> int:
- factors = (5, 4, 3, 2, 7, 6, 5, 4)
- sum_ = 0
- for i in range(len(digits)):
- sum_ += digits[i] * factors[i]
- return sum_ % 11
-
- while True:
- # create an array of first 8 elements initialized randomly
- digits = self.generator.random.sample(range(10), 8)
- # sum those 8 digits according to (part of) the "modulo 11"
- sum_ = _checksum(digits)
- # determine the last digit to make it qualify the test
- control_number = 11 - sum_
- if control_number != 10:
- digits.append(control_number)
- break
-
- digits = "".join([str(digit) for digit in digits])
- # finally return our random but valid BSN
- return "CHE-" + digits[0:3] + "." + digits[3:6] + "." + digits[6:9]
-
- uid = ide
- # uid: german name for ide
- idi = ide
- # idi: italian name for ide
diff --git a/venv/lib/python3.11/site-packages/faker/providers/company/fr_CH/__pycache__/__init__.cpython-311.pyc b/venv/lib/python3.11/site-packages/faker/providers/company/fr_CH/__pycache__/__init__.cpython-311.pyc
deleted file mode 100644
index fd5c1c3..0000000
--- a/venv/lib/python3.11/site-packages/faker/providers/company/fr_CH/__pycache__/__init__.cpython-311.pyc
+++ /dev/null
Binary files differ