blindscrambler 0.1.4__cp39-abi3-macosx_11_0_arm64.whl → 0.1.6__cp39-abi3-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@
|
|
6
6
|
import secrets
|
7
7
|
import numpy as np
|
8
8
|
|
9
|
+
|
9
10
|
def uniform(a: float = 0.0, b: float = 1.0) -> float:
|
10
11
|
"""
|
11
12
|
Cryptographically secure sample
|
@@ -22,7 +23,7 @@ def exponentialdist(lam):
|
|
22
23
|
The number lambda that will be used to generate samples of the exponential distributions
|
23
24
|
|
24
25
|
Returns:
|
25
|
-
(2)
|
26
|
+
(2) x : double
|
26
27
|
A random sample that is exponentially distributed
|
27
28
|
|
28
29
|
Function description: Basically, this function performs Inverse Transform Sampling. You take a random number generated between [0, 1]
|
@@ -41,7 +42,35 @@ def exponentialdist(lam):
|
|
41
42
|
# return this sample :)
|
42
43
|
return x
|
43
44
|
|
45
|
+
def poissondist(lam):
|
46
|
+
"""
|
47
|
+
Params:
|
48
|
+
(1) lam : double
|
49
|
+
The number lambda that will be used to generate samples of the poisson distributions
|
50
|
+
|
51
|
+
Returns:
|
52
|
+
(2) x : double
|
53
|
+
A random sample that is poisson distributed
|
54
|
+
"""
|
55
|
+
# make cumulative function and k
|
56
|
+
cum = 0
|
57
|
+
x = 0
|
58
|
+
|
59
|
+
# make a random sample between (0, 1)
|
60
|
+
u = uniform()
|
61
|
+
|
62
|
+
# start with first probability mass
|
63
|
+
p = np.exp(-lam)
|
64
|
+
cum += p
|
44
65
|
|
66
|
+
# keep adding probabilities unyil condition is met
|
67
|
+
while cum < u:
|
68
|
+
x += 1
|
69
|
+
p *= lam / x
|
70
|
+
cum += p
|
71
|
+
|
72
|
+
return x
|
45
73
|
|
46
74
|
if __name__ == "__main__":
|
47
|
-
print("
|
75
|
+
print("testing")
|
76
|
+
|
@@ -1,13 +1,13 @@
|
|
1
|
-
blindscrambler-0.1.
|
2
|
-
blindscrambler-0.1.
|
1
|
+
blindscrambler-0.1.6.dist-info/METADATA,sha256=FuF5WPP-3OT7RMzQQttXRQafPUu3sOtJE7lxpYEMT4s,407
|
2
|
+
blindscrambler-0.1.6.dist-info/WHEEL,sha256=DLqF2HZq4W_umZdP6RnfAuqhmtX_UrV4mkqrSIMhipE,102
|
3
3
|
blindscrambler/__init__.py,sha256=N6o-PTyGSlQ4ny1UA4ByeNenVF-wCTALnyP4WJ8PGas,98
|
4
4
|
blindscrambler/_core.abi3.so,sha256=4uKUtCwAO1Hbvzv0FXAt38rEHYbg-Quio8CdkJ_UMrk,440112
|
5
5
|
blindscrambler/_core.pyi,sha256=b6oJaUXUzEzqUE5rpqefV06hl8o_JCU8pgKgIIzQgmc,33
|
6
6
|
blindscrambler/differential/__init__.py,sha256=INnk5rX2ae6mG5yynAQYKzpQ0BYsHquUhA9ZzbPVLm8,45
|
7
7
|
blindscrambler/differential/discrete.py,sha256=mPJg6YrDVuXK-dLXgb_VDqKl1IvKfSKahMA_rRTVKQY,369
|
8
8
|
blindscrambler/distributions/__init__.py,sha256=8O4VQvymecRFRP1njwAfbD4yUACA25RcLqn0QtZEjaE,58
|
9
|
-
blindscrambler/distributions/cvdistributions.py,sha256=
|
9
|
+
blindscrambler/distributions/cvdistributions.py,sha256=lgZnlYdlCJEhk6K4cAkZmtIED81156ZnaJAQQbHx96c,2025
|
10
10
|
blindscrambler/matrix/__init__.py,sha256=qlItVU8AVj_mP2NUJ3gor-lsovxk3Wxf5tUfKynoUbg,157
|
11
11
|
blindscrambler/matrix/elementary.py,sha256=hArZLiBTA_vW1EZ0RniECf6ybJiJxO7KNuVHb_TZFQU,3987
|
12
12
|
blindscrambler/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
|
-
blindscrambler-0.1.
|
13
|
+
blindscrambler-0.1.6.dist-info/RECORD,,
|
File without changes
|