randomgen 2.0.1__cp313-cp313-win_amd64.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.
Files changed (474) hide show
  1. randomgen/__init__.py +89 -0
  2. randomgen/_deprecated_value.py +22 -0
  3. randomgen/_pickle.py +127 -0
  4. randomgen/_register.py +62 -0
  5. randomgen/_seed_sequence.c +21913 -0
  6. randomgen/_seed_sequence.cp313-win_amd64.pyd +0 -0
  7. randomgen/_seed_sequence.pxd +18 -0
  8. randomgen/_seed_sequence.pyi +39 -0
  9. randomgen/_seed_sequence.pyx +481 -0
  10. randomgen/_version.py +16 -0
  11. randomgen/aes.c +17774 -0
  12. randomgen/aes.cp313-win_amd64.pyd +0 -0
  13. randomgen/aes.pxd +40 -0
  14. randomgen/aes.pyi +33 -0
  15. randomgen/aes.pyx +419 -0
  16. randomgen/api.pxd +35 -0
  17. randomgen/bounded_integers.pxd +42 -0
  18. randomgen/bounded_integers.pxd.in +39 -0
  19. randomgen/bounded_integers.pyx +1524 -0
  20. randomgen/bounded_integers.pyx.in +307 -0
  21. randomgen/chacha.c +15763 -0
  22. randomgen/chacha.cp313-win_amd64.pyd +0 -0
  23. randomgen/chacha.pxd +34 -0
  24. randomgen/chacha.pyi +31 -0
  25. randomgen/chacha.pyx +297 -0
  26. randomgen/common.c +38590 -0
  27. randomgen/common.cp313-win_amd64.pyd +0 -0
  28. randomgen/common.pxd +183 -0
  29. randomgen/common.pyi +30 -0
  30. randomgen/common.pyx +1335 -0
  31. randomgen/conftest.py +24 -0
  32. randomgen/distributions.pxd +33 -0
  33. randomgen/dsfmt.c +34300 -0
  34. randomgen/dsfmt.cp313-win_amd64.pyd +0 -0
  35. randomgen/dsfmt.pxd +45 -0
  36. randomgen/dsfmt.pyi +21 -0
  37. randomgen/dsfmt.pyx +295 -0
  38. randomgen/efiix64.c +14496 -0
  39. randomgen/efiix64.cp313-win_amd64.pyd +0 -0
  40. randomgen/efiix64.pxd +27 -0
  41. randomgen/efiix64.pyi +16 -0
  42. randomgen/efiix64.pyx +225 -0
  43. randomgen/entropy.c +32770 -0
  44. randomgen/entropy.cp313-win_amd64.pyd +0 -0
  45. randomgen/entropy.pyi +9 -0
  46. randomgen/entropy.pyx +169 -0
  47. randomgen/examples/cython/extending.pyx +70 -0
  48. randomgen/examples/cython/extending_distributions.pyx +54 -0
  49. randomgen/examples/cython/low_level.pyx +51 -0
  50. randomgen/examples/cython/setup.py +35 -0
  51. randomgen/examples/numba/extending.py +79 -0
  52. randomgen/examples/numba/extending_distributions.py +63 -0
  53. randomgen/generator.c +31584 -0
  54. randomgen/generator.cp313-win_amd64.pyd +0 -0
  55. randomgen/generator.pyi +160 -0
  56. randomgen/generator.pyx +1229 -0
  57. randomgen/hc128.c +13982 -0
  58. randomgen/hc128.cp313-win_amd64.pyd +0 -0
  59. randomgen/hc128.pxd +25 -0
  60. randomgen/hc128.pyi +24 -0
  61. randomgen/hc128.pyx +234 -0
  62. randomgen/jsf.c +17122 -0
  63. randomgen/jsf.cp313-win_amd64.pyd +0 -0
  64. randomgen/jsf.pxd +43 -0
  65. randomgen/jsf.pyi +20 -0
  66. randomgen/jsf.pyx +330 -0
  67. randomgen/legacy/__init__.py +3 -0
  68. randomgen/legacy/bounded_integers.pxd +42 -0
  69. randomgen/legacy/bounded_integers.pxd.in +39 -0
  70. randomgen/legacy/bounded_integers.pyx +813 -0
  71. randomgen/legacy/bounded_integers.pyx.in +122 -0
  72. randomgen/legacy/distributions.pxd +66 -0
  73. randomgen/lxm.c +15515 -0
  74. randomgen/lxm.cp313-win_amd64.pyd +0 -0
  75. randomgen/lxm.pxd +26 -0
  76. randomgen/lxm.pyi +20 -0
  77. randomgen/lxm.pyx +297 -0
  78. randomgen/mt19937.c +16327 -0
  79. randomgen/mt19937.cp313-win_amd64.pyd +0 -0
  80. randomgen/mt19937.pxd +27 -0
  81. randomgen/mt19937.pyi +27 -0
  82. randomgen/mt19937.pyx +323 -0
  83. randomgen/mt64.c +14516 -0
  84. randomgen/mt64.cp313-win_amd64.pyd +0 -0
  85. randomgen/mt64.pxd +25 -0
  86. randomgen/mt64.pyi +18 -0
  87. randomgen/mt64.pyx +179 -0
  88. randomgen/mtrand.pyi +59 -0
  89. randomgen/mtrand.pyx +169 -0
  90. randomgen/pcg32.c +15269 -0
  91. randomgen/pcg32.cp313-win_amd64.pyd +0 -0
  92. randomgen/pcg32.pxd +27 -0
  93. randomgen/pcg32.pyi +19 -0
  94. randomgen/pcg32.pyx +307 -0
  95. randomgen/pcg64.c +26617 -0
  96. randomgen/pcg64.cp313-win_amd64.pyd +0 -0
  97. randomgen/pcg64.pxd +82 -0
  98. randomgen/pcg64.pyi +63 -0
  99. randomgen/pcg64.pyx +1138 -0
  100. randomgen/philox.c +20165 -0
  101. randomgen/philox.cp313-win_amd64.pyd +0 -0
  102. randomgen/philox.pxd +103 -0
  103. randomgen/philox.pxd.in +68 -0
  104. randomgen/philox.pyi +35 -0
  105. randomgen/philox.pyx +568 -0
  106. randomgen/py.typed +0 -0
  107. randomgen/rdrand.c +36841 -0
  108. randomgen/rdrand.cp313-win_amd64.pyd +0 -0
  109. randomgen/rdrand.pxd +18 -0
  110. randomgen/rdrand.pyi +32 -0
  111. randomgen/rdrand.pyx +479 -0
  112. randomgen/romu.c +15474 -0
  113. randomgen/romu.cp313-win_amd64.pyd +0 -0
  114. randomgen/romu.pxd +29 -0
  115. randomgen/romu.pyi +16 -0
  116. randomgen/romu.pyx +207 -0
  117. randomgen/seed_sequence.py +29 -0
  118. randomgen/sfc.c +17787 -0
  119. randomgen/sfc.cp313-win_amd64.pyd +0 -0
  120. randomgen/sfc.pxd +26 -0
  121. randomgen/sfc.pyi +24 -0
  122. randomgen/sfc.pyx +377 -0
  123. randomgen/sfmt.c +34744 -0
  124. randomgen/sfmt.cp313-win_amd64.pyd +0 -0
  125. randomgen/sfmt.pxd +43 -0
  126. randomgen/sfmt.pyi +21 -0
  127. randomgen/sfmt.pyx +305 -0
  128. randomgen/speck128.c +16816 -0
  129. randomgen/speck128.cp313-win_amd64.pyd +0 -0
  130. randomgen/speck128.pxd +40 -0
  131. randomgen/speck128.pyi +38 -0
  132. randomgen/speck128.pyx +440 -0
  133. randomgen/src/aesctr/LICENSE.md +232 -0
  134. randomgen/src/aesctr/aesctr-test-data-gen.c +86 -0
  135. randomgen/src/aesctr/aesctr.c +210 -0
  136. randomgen/src/aesctr/aesctr.h +142 -0
  137. randomgen/src/aesctr/aesctr.orig.h +133 -0
  138. randomgen/src/aesctr/softaes.h +217 -0
  139. randomgen/src/aesctr/tiny-aes.c +572 -0
  140. randomgen/src/aesctr/tiny-aes.h +90 -0
  141. randomgen/src/aligned_malloc/aligned_malloc.c +9 -0
  142. randomgen/src/aligned_malloc/aligned_malloc.h +54 -0
  143. randomgen/src/chacha/LICENSE.md +16 -0
  144. randomgen/src/chacha/chacha-benchmark.cpp +33 -0
  145. randomgen/src/chacha/chacha-test-data-gen.cpp +48 -0
  146. randomgen/src/chacha/chacha-v1.c +193 -0
  147. randomgen/src/chacha/chacha.c +68 -0
  148. randomgen/src/chacha/chacha.h +217 -0
  149. randomgen/src/chacha/chacha.orig.h +306 -0
  150. randomgen/src/common/LICENSE.md +29 -0
  151. randomgen/src/common/array.h +348 -0
  152. randomgen/src/common/cpu_features.c +54 -0
  153. randomgen/src/common/cpu_features.h +26 -0
  154. randomgen/src/common/features/clangfeatures.h +93 -0
  155. randomgen/src/common/features/compilerfeatures.h +344 -0
  156. randomgen/src/common/features/gccfeatures.h +263 -0
  157. randomgen/src/common/features/iccfeatures.h +212 -0
  158. randomgen/src/common/features/metalfeatures.h +111 -0
  159. randomgen/src/common/features/msvcfeatures.h +200 -0
  160. randomgen/src/common/features/nvccfeatures.h +125 -0
  161. randomgen/src/common/features/open64features.h +50 -0
  162. randomgen/src/common/features/openclfeatures.h +89 -0
  163. randomgen/src/common/features/pgccfeatures.h +194 -0
  164. randomgen/src/common/features/sse.h +280 -0
  165. randomgen/src/common/features/sunprofeatures.h +172 -0
  166. randomgen/src/common/features/xlcfeatures.h +210 -0
  167. randomgen/src/common/inttypes.h +305 -0
  168. randomgen/src/common/randomgen_config.h +85 -0
  169. randomgen/src/common/randomgen_config_numpy.h +25 -0
  170. randomgen/src/common/randomgen_endian.h +83 -0
  171. randomgen/src/common/randomgen_immintrin.h +30 -0
  172. randomgen/src/common/standalone/Python.h +11 -0
  173. randomgen/src/common/standalone/aligned_malloc.h +29 -0
  174. randomgen/src/common/standalone/npy_common.h +25 -0
  175. randomgen/src/common/standalone/npy_math.h +28 -0
  176. randomgen/src/common/stdbool.h +13 -0
  177. randomgen/src/common/stdint.h +258 -0
  178. randomgen/src/distributions/LICENSE.md +61 -0
  179. randomgen/src/distributions/binomial.h +0 -0
  180. randomgen/src/distributions/distributions.orig.c +1707 -0
  181. randomgen/src/distributions/distributions.orig.h +347 -0
  182. randomgen/src/distributions/hypergeometric.c +260 -0
  183. randomgen/src/distributions/logfactorial.c +158 -0
  184. randomgen/src/distributions/logfactorial.h +9 -0
  185. randomgen/src/distributions/loggam.h +45 -0
  186. randomgen/src/distributions/rg-distributions.c +90 -0
  187. randomgen/src/distributions/rg-distributions.h +54 -0
  188. randomgen/src/distributions/ziggurat.h +276 -0
  189. randomgen/src/distributions/ziggurat_constants.h +1196 -0
  190. randomgen/src/dsfmt/128-bit-jump.poly.txt +2 -0
  191. randomgen/src/dsfmt/96-bit-jump.poly.txt +2 -0
  192. randomgen/src/dsfmt/LICENSE.md +34 -0
  193. randomgen/src/dsfmt/calc-jump.cpp +81 -0
  194. randomgen/src/dsfmt/dSFMT-benchmark.c +43 -0
  195. randomgen/src/dsfmt/dSFMT-calc-jump.hpp +106 -0
  196. randomgen/src/dsfmt/dSFMT-common.h +115 -0
  197. randomgen/src/dsfmt/dSFMT-jump.c +184 -0
  198. randomgen/src/dsfmt/dSFMT-jump.h +29 -0
  199. randomgen/src/dsfmt/dSFMT-params.h +87 -0
  200. randomgen/src/dsfmt/dSFMT-params19937.h +40 -0
  201. randomgen/src/dsfmt/dSFMT-poly.h +351 -0
  202. randomgen/src/dsfmt/dSFMT-test-gen.c +58 -0
  203. randomgen/src/dsfmt/dsfmt-test-data-seed.h +1538 -0
  204. randomgen/src/dsfmt/dsfmt.c +656 -0
  205. randomgen/src/dsfmt/dsfmt.h +694 -0
  206. randomgen/src/efiix64/efiix64-test-gen.cpp +53 -0
  207. randomgen/src/efiix64/efiix64.c +60 -0
  208. randomgen/src/efiix64/efiix64.h +62 -0
  209. randomgen/src/entropy/LICENSE.md +25 -0
  210. randomgen/src/entropy/entropy.c +173 -0
  211. randomgen/src/entropy/entropy.h +34 -0
  212. randomgen/src/hc-128/hc-128-test-data-gen.c +87 -0
  213. randomgen/src/hc-128/hc-128.c +58 -0
  214. randomgen/src/hc-128/hc-128.h +127 -0
  215. randomgen/src/hc-128/hc-128.orig.c +98 -0
  216. randomgen/src/hc-128/hc-128.orig.h +39 -0
  217. randomgen/src/hc-128/hc128_ref.h +189 -0
  218. randomgen/src/hc-128/util.orig.c +49 -0
  219. randomgen/src/hc-128/util.orig.h +22 -0
  220. randomgen/src/jsf/jsf-test-data-gen.cpp +63 -0
  221. randomgen/src/jsf/jsf.c +34 -0
  222. randomgen/src/jsf/jsf.h +122 -0
  223. randomgen/src/jsf/jsf.hpp +179 -0
  224. randomgen/src/legacy/LICENSE.md +30 -0
  225. randomgen/src/legacy/legacy-distributions.c +492 -0
  226. randomgen/src/legacy/legacy-distributions.h +62 -0
  227. randomgen/src/lxm/lxm-test-data-gen.c +73 -0
  228. randomgen/src/lxm/lxm.c +62 -0
  229. randomgen/src/lxm/lxm.h +76 -0
  230. randomgen/src/mt19937/LICENSE.md +61 -0
  231. randomgen/src/mt19937/clist_mt19937.txt +1 -0
  232. randomgen/src/mt19937/generate-jump-test.py +110 -0
  233. randomgen/src/mt19937/jump_mt19937-orig.c +299 -0
  234. randomgen/src/mt19937/jump_mt19937.c +351 -0
  235. randomgen/src/mt19937/mt119937-test-data-seed.h +1258 -0
  236. randomgen/src/mt19937/mt19937-benchmark.c +31 -0
  237. randomgen/src/mt19937/mt19937-generate-jump-poly.c +190 -0
  238. randomgen/src/mt19937/mt19937-jump.c +159 -0
  239. randomgen/src/mt19937/mt19937-jump.h +15 -0
  240. randomgen/src/mt19937/mt19937-poly.h +1639 -0
  241. randomgen/src/mt19937/mt19937-test-data-gen.c +57 -0
  242. randomgen/src/mt19937/mt19937.c +166 -0
  243. randomgen/src/mt19937/mt19937.h +60 -0
  244. randomgen/src/mt19937/poly-128.txt +1 -0
  245. randomgen/src/mt19937/randomkit.c +649 -0
  246. randomgen/src/mt19937/randomkit.h +225 -0
  247. randomgen/src/mt64/mt64-test-data-gen.c +64 -0
  248. randomgen/src/mt64/mt64-test-data-seed.h +634 -0
  249. randomgen/src/mt64/mt64.c +138 -0
  250. randomgen/src/mt64/mt64.h +123 -0
  251. randomgen/src/mt64/mt64.orig.c +168 -0
  252. randomgen/src/mt64/mt64.orig.h +81 -0
  253. randomgen/src/pcg32/LICENSE.md +22 -0
  254. randomgen/src/pcg32/pcg-advance-64.c +62 -0
  255. randomgen/src/pcg32/pcg32-test-data-gen.c +66 -0
  256. randomgen/src/pcg32/pcg32.c +30 -0
  257. randomgen/src/pcg32/pcg32.h +82 -0
  258. randomgen/src/pcg32/pcg_variants.h +2210 -0
  259. randomgen/src/pcg64/LICENSE.md +22 -0
  260. randomgen/src/pcg64/lcg128mix.c +39 -0
  261. randomgen/src/pcg64/lcg128mix.h +106 -0
  262. randomgen/src/pcg64/pcg64-benchmark.c +41 -0
  263. randomgen/src/pcg64/pcg64-common.c +38 -0
  264. randomgen/src/pcg64/pcg64-common.h +145 -0
  265. randomgen/src/pcg64/pcg64-test-data-gen.c +77 -0
  266. randomgen/src/pcg64/pcg64-v2.c +70 -0
  267. randomgen/src/pcg64/pcg64-v2.h +149 -0
  268. randomgen/src/pcg64/pcg64.c +183 -0
  269. randomgen/src/pcg64/pcg64.h +388 -0
  270. randomgen/src/pcg64/pcg64.orig.c +11 -0
  271. randomgen/src/pcg64/pcg64.orig.h +2025 -0
  272. randomgen/src/pcg64/pcg64_xslrr-test-data-gen.cpp +64 -0
  273. randomgen/src/pcg64/pcg_dxsm-test-data-gen.cpp +58 -0
  274. randomgen/src/pcg64/pcg_extras.hpp +664 -0
  275. randomgen/src/pcg64/pcg_random.hpp +1947 -0
  276. randomgen/src/pcg64/pcg_uint128.hpp +884 -0
  277. randomgen/src/pcg64/pcg_xslrr-test-data-gen.cpp +60 -0
  278. randomgen/src/philox/LICENSE.md +31 -0
  279. randomgen/src/philox/philox-4x32-test-data-gen.c +84 -0
  280. randomgen/src/philox/philox-benchmark.c +38 -0
  281. randomgen/src/philox/philox-test-data-gen.c +84 -0
  282. randomgen/src/philox/philox.c +48 -0
  283. randomgen/src/philox/philox.h +495 -0
  284. randomgen/src/rdrand/rdrand.c +17 -0
  285. randomgen/src/rdrand/rdrand.h +119 -0
  286. randomgen/src/romu/romu-orig.h +154 -0
  287. randomgen/src/romu/romu-test-data-gen.c +130 -0
  288. randomgen/src/romu/romu.c +21 -0
  289. randomgen/src/romu/romu.h +105 -0
  290. randomgen/src/sfc/sfc-test-data-gen.c +81 -0
  291. randomgen/src/sfc/sfc.c +15 -0
  292. randomgen/src/sfc/sfc.h +90 -0
  293. randomgen/src/sfmt/SFMT-calc-jump.hpp +106 -0
  294. randomgen/src/sfmt/calc-jump.cpp +88 -0
  295. randomgen/src/sfmt/sfmt-alti.h +157 -0
  296. randomgen/src/sfmt/sfmt-common.h +161 -0
  297. randomgen/src/sfmt/sfmt-jump.c +129 -0
  298. randomgen/src/sfmt/sfmt-jump.h +28 -0
  299. randomgen/src/sfmt/sfmt-neon.h +115 -0
  300. randomgen/src/sfmt/sfmt-params.h +98 -0
  301. randomgen/src/sfmt/sfmt-params19937.h +58 -0
  302. randomgen/src/sfmt/sfmt-poly.h +349 -0
  303. randomgen/src/sfmt/sfmt-sse2-msc.h +308 -0
  304. randomgen/src/sfmt/sfmt-sse2.h +115 -0
  305. randomgen/src/sfmt/sfmt-test-data-seed.h +1258 -0
  306. randomgen/src/sfmt/sfmt-test-gen.c +53 -0
  307. randomgen/src/sfmt/sfmt.c +468 -0
  308. randomgen/src/sfmt/sfmt.h +352 -0
  309. randomgen/src/speck-128/speck-128-common.h +46 -0
  310. randomgen/src/speck-128/speck-128-sse.h +144 -0
  311. randomgen/src/speck-128/speck-128.c +86 -0
  312. randomgen/src/speck-128/speck-128.h +142 -0
  313. randomgen/src/speck-128/speck-128.ref.c +125 -0
  314. randomgen/src/speck-128/speck-test-data-gen.cpp +90 -0
  315. randomgen/src/splitmix64/LICENSE.md +9 -0
  316. randomgen/src/splitmix64/splitmix64.c +29 -0
  317. randomgen/src/splitmix64/splitmix64.h +30 -0
  318. randomgen/src/splitmix64/splitmix64.orig.c +28 -0
  319. randomgen/src/threefry/LICENSE.md +31 -0
  320. randomgen/src/threefry/threefry-benchmark.c +38 -0
  321. randomgen/src/threefry/threefry-orig.c +83 -0
  322. randomgen/src/threefry/threefry-test-data-gen.c +88 -0
  323. randomgen/src/threefry/threefry.c +48 -0
  324. randomgen/src/threefry/threefry.h +869 -0
  325. randomgen/src/threefry/threefry4x32-test-data-gen.c +90 -0
  326. randomgen/src/xoroshiro128/LICENSE.md +9 -0
  327. randomgen/src/xoroshiro128/xoroshiro128-benchmark.c +35 -0
  328. randomgen/src/xoroshiro128/xoroshiro128-test-data-gen.c +76 -0
  329. randomgen/src/xoroshiro128/xoroshiro128.c +83 -0
  330. randomgen/src/xoroshiro128/xoroshiro128.h +84 -0
  331. randomgen/src/xoroshiro128/xoroshiro128plus.orig.c +102 -0
  332. randomgen/src/xoroshiro128/xoroshiro128plus.orig.h +5 -0
  333. randomgen/src/xoroshiro128/xoroshiro128plusplus-test-data-gen.c +76 -0
  334. randomgen/src/xoroshiro128/xoroshiro128plusplus.orig.c +87 -0
  335. randomgen/src/xorshift1024/LICENSE.md +9 -0
  336. randomgen/src/xorshift1024/xorshift1024-benchmark.c +35 -0
  337. randomgen/src/xorshift1024/xorshift1024-test-data-gen.c +98 -0
  338. randomgen/src/xorshift1024/xorshift1024.c +32 -0
  339. randomgen/src/xorshift1024/xorshift1024.h +39 -0
  340. randomgen/src/xorshift1024/xorshift1024.orig.c +68 -0
  341. randomgen/src/xorshift1024/xorshift1024.orig.h +7 -0
  342. randomgen/src/xoshiro256/LICENSE.md +9 -0
  343. randomgen/src/xoshiro256/xoshiro256-benchmark-indirect.c +35 -0
  344. randomgen/src/xoshiro256/xoshiro256-benchmark.c +135 -0
  345. randomgen/src/xoshiro256/xoshiro256-test-data-gen.c +71 -0
  346. randomgen/src/xoshiro256/xoshiro256.c +55 -0
  347. randomgen/src/xoshiro256/xoshiro256.h +52 -0
  348. randomgen/src/xoshiro256/xoshiro256.orig.c +103 -0
  349. randomgen/src/xoshiro256/xoshiro256.orig.h +5 -0
  350. randomgen/src/xoshiro512/LICENSE.md +9 -0
  351. randomgen/src/xoshiro512/xoshiro512-test-data-gen.c +79 -0
  352. randomgen/src/xoshiro512/xoshiro512.c +51 -0
  353. randomgen/src/xoshiro512/xoshiro512.h +63 -0
  354. randomgen/src/xoshiro512/xoshiro512.orig.c +67 -0
  355. randomgen/src/xoshiro512/xoshiro512.orig.h +6 -0
  356. randomgen/tests/__init__.py +0 -0
  357. randomgen/tests/_shims.c +11080 -0
  358. randomgen/tests/_shims.cp313-win_amd64.pyd +0 -0
  359. randomgen/tests/_shims.pyi +9 -0
  360. randomgen/tests/_shims.pyx +15 -0
  361. randomgen/tests/data/__init__.py +0 -0
  362. randomgen/tests/data/_write_hashes.py +18 -0
  363. randomgen/tests/data/aesctr-testset-1.csv +1001 -0
  364. randomgen/tests/data/aesctr-testset-2.csv +1001 -0
  365. randomgen/tests/data/chacha-testset-1.csv +1001 -0
  366. randomgen/tests/data/chacha-testset-2.csv +1001 -0
  367. randomgen/tests/data/compute_hashes.py +260 -0
  368. randomgen/tests/data/dSFMT-testset-1.csv +1001 -0
  369. randomgen/tests/data/dSFMT-testset-2.csv +1001 -0
  370. randomgen/tests/data/efiix64-testset-1.csv +1001 -0
  371. randomgen/tests/data/efiix64-testset-2.csv +1001 -0
  372. randomgen/tests/data/hc-128-testset-1.csv +1001 -0
  373. randomgen/tests/data/hc-128-testset-2.csv +1001 -0
  374. randomgen/tests/data/jsf32-testset-1.csv +1001 -0
  375. randomgen/tests/data/jsf32-testset-2.csv +1001 -0
  376. randomgen/tests/data/jsf64-testset-1.csv +1001 -0
  377. randomgen/tests/data/jsf64-testset-2.csv +1001 -0
  378. randomgen/tests/data/lxm-testset-1.csv +1001 -0
  379. randomgen/tests/data/lxm-testset-2.csv +1001 -0
  380. randomgen/tests/data/mt19937-testset-1.csv +1001 -0
  381. randomgen/tests/data/mt19937-testset-2.csv +1001 -0
  382. randomgen/tests/data/mt64-testset-1.csv +1001 -0
  383. randomgen/tests/data/mt64-testset-2.csv +1001 -0
  384. randomgen/tests/data/pcg32-testset-1.csv +1001 -0
  385. randomgen/tests/data/pcg32-testset-2.csv +1001 -0
  386. randomgen/tests/data/pcg64-cm-dxsm-testset-1.csv +1001 -0
  387. randomgen/tests/data/pcg64-cm-dxsm-testset-2.csv +1001 -0
  388. randomgen/tests/data/pcg64-cm-xsl_rr-testset-1.csv +1000 -0
  389. randomgen/tests/data/pcg64-cm-xsl_rr-testset-2.csv +1001 -0
  390. randomgen/tests/data/pcg64-dxsm-testset-1.csv +1001 -0
  391. randomgen/tests/data/pcg64-dxsm-testset-2.csv +1001 -0
  392. randomgen/tests/data/pcg64-testset-1.csv +1001 -0
  393. randomgen/tests/data/pcg64-testset-2.csv +1001 -0
  394. randomgen/tests/data/pcg64-xsl_rr-testset-1.csv +1001 -0
  395. randomgen/tests/data/pcg64-xsl_rr-testset-2.csv +1001 -0
  396. randomgen/tests/data/philox-testset-1.csv +1001 -0
  397. randomgen/tests/data/philox-testset-2.csv +1001 -0
  398. randomgen/tests/data/philox4x32-testset-1.csv +1001 -0
  399. randomgen/tests/data/philox4x32-testset-2.csv +1001 -0
  400. randomgen/tests/data/romuquad-testset-1.csv +1001 -0
  401. randomgen/tests/data/romuquad-testset-2.csv +1001 -0
  402. randomgen/tests/data/romutrio-testset-1.csv +1001 -0
  403. randomgen/tests/data/romutrio-testset-2.csv +1001 -0
  404. randomgen/tests/data/sfc-testset-1.csv +1001 -0
  405. randomgen/tests/data/sfc-testset-2.csv +1001 -0
  406. randomgen/tests/data/sfmt-testset-1.csv +1001 -0
  407. randomgen/tests/data/sfmt-testset-2.csv +1001 -0
  408. randomgen/tests/data/speck-128-testset-1.csv +1001 -0
  409. randomgen/tests/data/speck-128-testset-2.csv +1001 -0
  410. randomgen/tests/data/stability_results.py +1729 -0
  411. randomgen/tests/data/stable_hashes.py +3941 -0
  412. randomgen/tests/data/threefry-testset-1.csv +1001 -0
  413. randomgen/tests/data/threefry-testset-2.csv +1001 -0
  414. randomgen/tests/data/threefry32-testset-1.csv +1001 -0
  415. randomgen/tests/data/threefry32-testset-2.csv +1001 -0
  416. randomgen/tests/data/xoroshiro128-testset-1.csv +1001 -0
  417. randomgen/tests/data/xoroshiro128-testset-2.csv +1001 -0
  418. randomgen/tests/data/xoroshiro128plusplus-testset-1.csv +1001 -0
  419. randomgen/tests/data/xoroshiro128plusplus-testset-2.csv +1001 -0
  420. randomgen/tests/data/xorshift1024-testset-1.csv +1001 -0
  421. randomgen/tests/data/xorshift1024-testset-2.csv +1001 -0
  422. randomgen/tests/data/xoshiro256-testset-1.csv +1001 -0
  423. randomgen/tests/data/xoshiro256-testset-2.csv +1001 -0
  424. randomgen/tests/data/xoshiro512-testset-1.csv +1001 -0
  425. randomgen/tests/data/xoshiro512-testset-2.csv +1001 -0
  426. randomgen/tests/test_bit_generators_against_numpy.py +45 -0
  427. randomgen/tests/test_common.py +81 -0
  428. randomgen/tests/test_direct.py +2036 -0
  429. randomgen/tests/test_extended_generator.py +717 -0
  430. randomgen/tests/test_final_release_changes.py +43 -0
  431. randomgen/tests/test_generator_mt19937.py +78 -0
  432. randomgen/tests/test_lcg128mix_pcg64dxsm.py +214 -0
  433. randomgen/tests/test_seed_sequence.py +229 -0
  434. randomgen/tests/test_sfc.py +54 -0
  435. randomgen/tests/test_smoke.py +1392 -0
  436. randomgen/tests/test_stability.py +260 -0
  437. randomgen/tests/test_wrapper.py +119 -0
  438. randomgen/tests/test_wrapper_numba.py +233 -0
  439. randomgen/threefry.c +19055 -0
  440. randomgen/threefry.cp313-win_amd64.pyd +0 -0
  441. randomgen/threefry.pxd +103 -0
  442. randomgen/threefry.pxd.in +68 -0
  443. randomgen/threefry.pyi +33 -0
  444. randomgen/threefry.pyx +537 -0
  445. randomgen/typing.py +13 -0
  446. randomgen/wrapper.c +19279 -0
  447. randomgen/wrapper.cp313-win_amd64.pyd +0 -0
  448. randomgen/wrapper.pyi +46 -0
  449. randomgen/wrapper.pyx +329 -0
  450. randomgen/xoroshiro128.c +15815 -0
  451. randomgen/xoroshiro128.cp313-win_amd64.pyd +0 -0
  452. randomgen/xoroshiro128.pxd +28 -0
  453. randomgen/xoroshiro128.pyi +20 -0
  454. randomgen/xoroshiro128.pyx +306 -0
  455. randomgen/xorshift1024.c +15508 -0
  456. randomgen/xorshift1024.cp313-win_amd64.pyd +0 -0
  457. randomgen/xorshift1024.pxd +23 -0
  458. randomgen/xorshift1024.pyi +20 -0
  459. randomgen/xorshift1024.pyx +277 -0
  460. randomgen/xoshiro256.c +15557 -0
  461. randomgen/xoshiro256.cp313-win_amd64.pyd +0 -0
  462. randomgen/xoshiro256.pxd +22 -0
  463. randomgen/xoshiro256.pyi +16 -0
  464. randomgen/xoshiro256.pyx +280 -0
  465. randomgen/xoshiro512.c +15490 -0
  466. randomgen/xoshiro512.cp313-win_amd64.pyd +0 -0
  467. randomgen/xoshiro512.pxd +22 -0
  468. randomgen/xoshiro512.pyi +16 -0
  469. randomgen/xoshiro512.pyx +274 -0
  470. randomgen-2.0.1.dist-info/LICENSE.md +108 -0
  471. randomgen-2.0.1.dist-info/METADATA +220 -0
  472. randomgen-2.0.1.dist-info/RECORD +474 -0
  473. randomgen-2.0.1.dist-info/WHEEL +5 -0
  474. randomgen-2.0.1.dist-info/top_level.txt +1 -0
randomgen/__init__.py ADDED
@@ -0,0 +1,89 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ import sys
5
+
6
+ from randomgen._register import BitGenerators
7
+ from randomgen.aes import AESCounter
8
+ from randomgen.chacha import ChaCha
9
+ from randomgen.dsfmt import DSFMT
10
+ from randomgen.efiix64 import EFIIX64
11
+ from randomgen.entropy import random_entropy
12
+ from randomgen.generator import ExtendedGenerator
13
+ from randomgen.hc128 import HC128
14
+ from randomgen.jsf import JSF
15
+ from randomgen.lxm import LXM
16
+ from randomgen.mt64 import MT64
17
+ from randomgen.mt19937 import MT19937
18
+ from randomgen.pcg32 import PCG32
19
+ from randomgen.pcg64 import PCG64, PCG64DXSM, LCG128Mix
20
+ from randomgen.philox import Philox
21
+ from randomgen.rdrand import RDRAND
22
+ from randomgen.romu import Romu
23
+ from randomgen.seed_sequence import SeedlessSeedSequence, SeedSequence
24
+ from randomgen.sfc import SFC64
25
+ from randomgen.sfmt import SFMT
26
+ from randomgen.speck128 import SPECK128
27
+ from randomgen.threefry import ThreeFry
28
+ from randomgen.wrapper import UserBitGenerator
29
+ from randomgen.xoroshiro128 import Xoroshiro128
30
+ from randomgen.xorshift1024 import Xorshift1024
31
+ from randomgen.xoshiro256 import Xoshiro256
32
+ from randomgen.xoshiro512 import Xoshiro512
33
+
34
+ from ._version import version as __version__, version_tuple as __version_info__
35
+
36
+ PKG = os.path.join(os.path.dirname(__file__))
37
+
38
+
39
+ __all__ = [
40
+ "AESCounter",
41
+ "BitGenerators",
42
+ "ChaCha",
43
+ "DSFMT",
44
+ "EFIIX64",
45
+ "ExtendedGenerator",
46
+ "HC128",
47
+ "JSF",
48
+ "LCG128Mix",
49
+ "LXM",
50
+ "MT19937",
51
+ "MT64",
52
+ "PCG32",
53
+ "PCG64",
54
+ "PCG64DXSM",
55
+ "Philox",
56
+ "RDRAND",
57
+ "Romu",
58
+ "SFC64",
59
+ "SFMT",
60
+ "SPECK128",
61
+ "SeedSequence",
62
+ "SeedlessSeedSequence",
63
+ "ThreeFry",
64
+ "UserBitGenerator",
65
+ "Xoroshiro128",
66
+ "Xorshift1024",
67
+ "Xoshiro256",
68
+ "Xoshiro512",
69
+ "random_entropy",
70
+ "__version__",
71
+ "__version_info__",
72
+ ]
73
+
74
+
75
+ def test(extra_args: str | list[str] | None = None) -> None:
76
+ try:
77
+ import pytest
78
+ except ImportError as err:
79
+ raise ImportError("Need pytest>=5.0.1 to run tests") from err
80
+ cmd = ["--skip-slow"]
81
+ if extra_args:
82
+ if not isinstance(extra_args, list):
83
+ extra_args = [extra_args]
84
+ assert isinstance(extra_args, list)
85
+ cmd = extra_args
86
+ cmd += [PKG]
87
+ joined = " ".join(cmd)
88
+ print(f"running: pytest {joined}")
89
+ sys.exit(pytest.main(cmd))
@@ -0,0 +1,22 @@
1
+ class _DeprecatedValueType:
2
+ """Special keyword value for deprecated arguments..
3
+
4
+ The instance of this class may be used as the default value assigned to a
5
+ keyword if the parameter is deprecated.
6
+ """
7
+
8
+ __instance = None
9
+
10
+ def __new__(cls):
11
+ # ensure that only one instance exists
12
+ if not cls.__instance:
13
+ cls.__instance = super().__new__(cls)
14
+ return cls.__instance
15
+
16
+ def __repr__(self):
17
+ return "<deprecated>"
18
+
19
+
20
+ _DeprecatedValue = _DeprecatedValueType()
21
+
22
+ __all__ = ["_DeprecatedValue"]
randomgen/_pickle.py ADDED
@@ -0,0 +1,127 @@
1
+ from __future__ import annotations
2
+
3
+ import warnings
4
+
5
+ from randomgen.aes import AESCounter
6
+ from randomgen.chacha import ChaCha
7
+ from randomgen.common import BitGenerator
8
+ from randomgen.dsfmt import DSFMT
9
+ from randomgen.efiix64 import EFIIX64
10
+ from randomgen.generator import ExtendedGenerator
11
+ from randomgen.hc128 import HC128
12
+ from randomgen.jsf import JSF
13
+ from randomgen.lxm import LXM
14
+ from randomgen.mt64 import MT64
15
+ from randomgen.mt19937 import MT19937
16
+ from randomgen.pcg32 import PCG32
17
+ from randomgen.pcg64 import PCG64, PCG64DXSM, LCG128Mix
18
+ from randomgen.philox import Philox
19
+ from randomgen.rdrand import RDRAND
20
+ from randomgen.romu import Romu
21
+ from randomgen.sfc import SFC64
22
+ from randomgen.sfmt import SFMT
23
+ from randomgen.speck128 import SPECK128
24
+ from randomgen.threefry import ThreeFry
25
+ from randomgen.xoroshiro128 import Xoroshiro128
26
+ from randomgen.xorshift1024 import Xorshift1024
27
+ from randomgen.xoshiro256 import Xoshiro256
28
+ from randomgen.xoshiro512 import Xoshiro512
29
+
30
+ BitGenerators: dict[str, type[BitGenerator]] = {
31
+ "AESCounter": AESCounter,
32
+ "ChaCha": ChaCha,
33
+ "LCG128Mix": LCG128Mix,
34
+ "DSFMT": DSFMT,
35
+ "EFIIX64": EFIIX64,
36
+ "HC128": HC128,
37
+ "JSF": JSF,
38
+ "LXM": LXM,
39
+ "MT19937": MT19937,
40
+ "MT64": MT64,
41
+ "PCG32": PCG32,
42
+ "PCG64": PCG64,
43
+ "PCG64DXSM": PCG64DXSM,
44
+ "Philox": Philox,
45
+ "Romu": Romu,
46
+ "ThreeFry": ThreeFry,
47
+ "Xorshift1024": Xorshift1024,
48
+ "Xoroshiro128": Xoroshiro128,
49
+ "Xoshiro256": Xoshiro256,
50
+ "Xoshiro512": Xoshiro512,
51
+ "SPECK128": SPECK128,
52
+ "SFC64": SFC64,
53
+ "SFMT": SFMT,
54
+ "RDRAND": RDRAND,
55
+ }
56
+
57
+ # Assign the fully qualified name for future proofness
58
+ for value in list(BitGenerators.values()):
59
+ BitGenerators[f"{value.__module__}.{value.__name__}"] = value
60
+
61
+
62
+ def _get_bitgenerator(bit_generator_name: str) -> type[BitGenerator]:
63
+ """
64
+ Bit generator look-up with user-friendly errors
65
+ """
66
+ if bit_generator_name in BitGenerators:
67
+ bit_generator = BitGenerators[bit_generator_name]
68
+ else:
69
+ raise ValueError(
70
+ str(bit_generator_name) + " is not a known BitGenerator module."
71
+ )
72
+ return bit_generator
73
+
74
+
75
+ def _decode(name: str | bytes) -> str:
76
+ if isinstance(name, str):
77
+ return name
78
+ assert isinstance(name, bytes)
79
+ return name.decode("ascii")
80
+
81
+
82
+ def __extended_generator_ctor(
83
+ bit_generator_name: str | bytes = "MT19937",
84
+ ) -> ExtendedGenerator:
85
+ """
86
+ Pickling helper function that returns a Generator object
87
+
88
+ Parameters
89
+ ----------
90
+ bit_generator_name: str
91
+ String containing the core BitGenerator
92
+
93
+ Returns
94
+ -------
95
+ rg: Generator
96
+ Generator using the named core BitGenerator
97
+ """
98
+ bit_generator_name = _decode(bit_generator_name)
99
+ assert isinstance(bit_generator_name, str)
100
+ bit_generator = _get_bitgenerator(bit_generator_name)
101
+ with warnings.catch_warnings():
102
+ warnings.filterwarnings("ignore", category=FutureWarning)
103
+ bit_gen = bit_generator()
104
+ return ExtendedGenerator(bit_gen)
105
+
106
+
107
+ def __bit_generator_ctor(bit_generator_name: str | bytes = "MT19937") -> BitGenerator:
108
+ """
109
+ Pickling helper function that returns a bit generator object
110
+
111
+ Parameters
112
+ ----------
113
+ bit_generator_name: str
114
+ String containing the name of the bit generator
115
+
116
+ Returns
117
+ -------
118
+ bit_generator: BitGenerator
119
+ Bit generator instance
120
+ """
121
+ bit_generator_name = _decode(bit_generator_name)
122
+ assert isinstance(bit_generator_name, str)
123
+ bit_generator = _get_bitgenerator(bit_generator_name)
124
+ with warnings.catch_warnings():
125
+ warnings.filterwarnings("ignore", category=FutureWarning)
126
+ bit_gen = bit_generator()
127
+ return bit_gen
randomgen/_register.py ADDED
@@ -0,0 +1,62 @@
1
+ from numpy.random._pickle import BitGenerators
2
+
3
+ from randomgen.aes import AESCounter
4
+ from randomgen.chacha import ChaCha
5
+ from randomgen.dsfmt import DSFMT
6
+ from randomgen.efiix64 import EFIIX64
7
+ from randomgen.hc128 import HC128
8
+ from randomgen.jsf import JSF
9
+ from randomgen.lxm import LXM
10
+ from randomgen.mt64 import MT64
11
+ from randomgen.mt19937 import MT19937
12
+ from randomgen.pcg32 import PCG32
13
+ from randomgen.pcg64 import PCG64, PCG64DXSM, LCG128Mix
14
+ from randomgen.philox import Philox
15
+ from randomgen.rdrand import RDRAND
16
+ from randomgen.romu import Romu
17
+ from randomgen.sfc import SFC64
18
+ from randomgen.sfmt import SFMT
19
+ from randomgen.speck128 import SPECK128
20
+ from randomgen.threefry import ThreeFry
21
+ from randomgen.wrapper import UserBitGenerator
22
+ from randomgen.xoroshiro128 import Xoroshiro128
23
+ from randomgen.xorshift1024 import Xorshift1024
24
+ from randomgen.xoshiro256 import Xoshiro256
25
+ from randomgen.xoshiro512 import Xoshiro512
26
+
27
+ bit_generators = [
28
+ AESCounter,
29
+ ChaCha,
30
+ DSFMT,
31
+ EFIIX64,
32
+ HC128,
33
+ JSF,
34
+ LXM,
35
+ MT19937,
36
+ MT64,
37
+ PCG32,
38
+ PCG64,
39
+ PCG64DXSM,
40
+ LCG128Mix,
41
+ Philox,
42
+ RDRAND,
43
+ Romu,
44
+ SFC64,
45
+ SFMT,
46
+ SPECK128,
47
+ ThreeFry,
48
+ UserBitGenerator,
49
+ Xoroshiro128,
50
+ Xorshift1024,
51
+ Xoshiro256,
52
+ Xoshiro512,
53
+ ]
54
+
55
+ for bitgen in bit_generators:
56
+ key = f"{bitgen.__name__}"
57
+ if key not in BitGenerators:
58
+ BitGenerators[key] = bitgen
59
+ full_key = f"{bitgen.__module__}.{bitgen.__name__}"
60
+ BitGenerators[full_key] = bitgen
61
+
62
+ __all__ = ["BitGenerators"]