Metadata-Version: 2.1
Name: shishua
Version: 0.2.0
Summary: SHISHUA: The fastest PRNG. A seedrandom-compatible random number generator.
Home-page: https://github.com/espadrine/shishua-python
Author: Thaddée Tyl
Author-email: thaddee.tyl@gmail.com
License: UNKNOWN
Project-URL: Bug Tracker, https://github.com/espadrine/shishua-python/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX
Classifier: Operating System :: Unix
Classifier: Operating System :: MacOS
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

# SHISHUA for Python: The fastest PRNG

The official page for SHISHUA is [here][SHISHUA].  
This [PyPI][] package provides bindings for Python.

```python
from shishua import SHISHUA
rng = SHISHUA(0)
buffer = rng.random_raw(1 << 30)  # 1 GiB
# It takes 1s on my laptop.
```

NumPy support:

```python
import numpy
from shishua import SHISHUA
buffer = numpy.random.Generator(SHISHUA()).bytes(1024)
print(buffer.hex())
```

## API

### `SHISHUA(seed=None)`

Returns a generator instance initialized with the given seed.

The `seed` determines the sequence of numbers that this function returns:

```python
print(SHISHUA('seed').random_raw(10).hex())
#> 1aa64a39f6949b969e97
print(SHISHUA('seed').random_raw(10).hex())
#> 1aa64a39f6949b969e97
print(SHISHUA('different seed, different values').random_raw(10).hex())
#> 216a0889a858eb57ae30
```

The seed can be either:

- A list of four 64-bit integers,
  to map exactly to the functionality provided
  by the underlying SHISHUA algorithm,
- A string, which is hashed into the four integers,
- A single integer, which sets the first of the four,
- If not provided (or undefined),
  a random seed is generated from the system's CSPRNG.

### Associated methods

The object returned by calling `SHISHUA()` also has the following methods,
which all tap into the stream generated by the seed:

- `.random_raw(size)`, which returns a `bytes` filled with random bytes.

[SHISHUA]: https://github.com/espadrine/shishua
[PyPI]: https://pypi.org/project/shishua/


