RandTest
A light package for quick and accurate determinations of the randomness of a sequence.
Overview
Identifying random patterns, and conversely, ordered patterns, is a major tool with applicability to a wide variety of fields, from mathematical analysis to cybersecurity. Random Test looks for randomness in sequences of numbers by searching for patterns which are inherently unpredictable. It uses an exponentially-decaying moment prediction to determine the net deviation between the predicted and actual elements of a sequence. In tests, this led to a net predictive accuracy of 99.85% for nonrandom sequences and 96.82% for random sequences. Additionally, this package is able to provide these predictions in under a millisecond for sequences shorter than 10 elements and under 100 milliseconds for sequences shorter than 1000 elements.
Requirements
RandTest is built for Python 3. It has only one requirement:
- Numpy
Installation
To download randtest, use PyPI via pip:
$ pip install randtest
Alternatively, you can clone this Github repository and build from source:
$ git clone https://github.com/sudo-rushil/randtest
$ cd randtest
$ python setup.py install
Verify your installation by running
>>> import randtest
>>> randtest.random_score([0, 1, 2, 3])
'False'
Examples
RandTest is extremely simple to use. You only need to input either a list or a 1D Numpy array of numbers. The prediction returns False if the sequence is ordered and True if the sequence is random.
import numpy as np
import randtest as rt
ordered_sequence = np.arange(10)
random_sequence = np.random.randint(10, size=10)
print(rt.random_score(ordered_sequence))
print(rt.random_score(random_sequence))
False
True
Metadata
Release files for randtest 0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| randtest-0.7.tar.gz | 4.8 kB | Without provenance | Details |
Release files / randtest-0.7.tar.gz
| Download URL | randtest-0.7.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ab77a76f8a93354ab915d152532ca09559c75a386afdc5e597eba6a479697e1b
|
|
BLAKE2b-256 checksum How to use checksums |
f8fe251b02e420949d58e310e9b434c70b00d75c7c79d077d2833b6185e0e0e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
|
Security for randtest 0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.