A module for efficiently generating very large random permutations
Project description
Random Permutation
This module provides a class RandomPermutation
that can be used to
generate a random permutation of a given length in O(1) time and space.
Installation
To install the module, run:
pip install random_permutation
Usage
To use the RandomPermutation
class, import it from the random_permutation
module:
from random_permutation import RandomPermutation
n = 2**20
p = RandomPermutation(n)
for x in p:
print(x)
# or
for i in range(n):
print(p[i])
This will output the elements of the RandomPermutation
object. You can
use the seed
parameter to vary the permutations and the num_ciphers
parameter to control the number of ciphers used.
Testing
To run the unit tests for the RandomPermutation
class, run:
python -m unittest tests.test_permutation
License
This module is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for random_permutation-0.1.15.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53683fb7ee207e0cf94d302884759ab8f6427b2998c643def004ab4ded6483f0 |
|
MD5 | db9f941bc50b38ad9a9f0f58f4f9e0d5 |
|
BLAKE2b-256 | 25681148badf6cd0a468c4ba3b113f08761424b2a6468b18e8a9570c34beffa1 |
Close
Hashes for random_permutation-0.1.15-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7f918b548653eea97b38f014c8bc1cd9072abeb92f0d5ce6fcc559426020960 |
|
MD5 | 083de4d204bc9b574eebb681de550aa6 |
|
BLAKE2b-256 | 2b2cd67b326e21f8b6f7b1de61c04114e19b7614a295a5def57480a7c558ea03 |