Skip to main content

Python driver for the RAVA RNG device

Project description

RAVA Python Driver

Website Docs Author Publication

OS Python PyPI License

The RAVA Python Driver provides a Python interface for communicating with RAVA8 True Random Number Generator (TRNG) devices running the RAVA8 Firmware.

Features

  • USB communication with RAVA8 devices
  • Random bit, byte, integer and floating-point generation
  • TCP relay server supporting simultaneous access by multiple TCP clients

Requirements

Installation

The driver is available on PyPI as rng_rava. After creating and activating a Python virtual environment, install it with:

pip install rng_rava

Usage

import rng_rava as rava

# Find the serial number of the attached RAVA devices
rava_sns = rava.find_rava_sns()

# Create a RNG_USB instance and connect to the first device
rng = rava.RAVA_USB()
rng.open(rava_sns[0])

# Measure 100 pulse counts
pc_a, pc_b = rng.gen_pulse_counts(n_counts=100)

# Generate a random bit XORing both cores
bit = rng.gen_bit(rng_cores=rava.R_RngCores.AB_XOR)

# Generate 100 random bytes in each core
bytes_a, bytes_b = rng.gen_bytes(n_bytes=100)

# Generate 100 8-bit integers between 0 and 99
ints8 = rng.gen_int8s(n_ints=100, delta=100)

# Generate 100 16-bit integers between 0 and 999
ints16 = rng.gen_int16s(n_ints=100, delta=1000)

# Generate 100 32-bit floats ranging between 0 and 1
floats = rng.gen_floats(n_floats=100)

# Close RAVA device
rng.close()

Additional examples are available in the examples/ directory.

Firmware Compatibility

Firmware Version Driver Version
v1.0.0 v1.1.0 – v1.2.1
≥ v2.0.0 ≥ v2.0.0
≥ v3.0.0 ≥ v3.0.0

Contact

gabrielguerrer.com

RAVA logo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rng_rava-3.0.0.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rng_rava-3.0.0-py3-none-any.whl (38.0 kB view details)

Uploaded Python 3

File details

Details for the file rng_rava-3.0.0.tar.gz.

File metadata

  • Download URL: rng_rava-3.0.0.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rng_rava-3.0.0.tar.gz
Algorithm Hash digest
SHA256 85a9c02f0b05a7c219d5421ae2045bd1742daeb47152f19f4a0d9bf3e3ab8b29
MD5 ea90a961f78cafac2461ca72ee15ac74
BLAKE2b-256 4462a84fda8467a519f3601ba49fdd4657dd0696322d19437297235f39a93baa

See more details on using hashes here.

Provenance

The following attestation bundles were made for rng_rava-3.0.0.tar.gz:

Publisher: python-publish.yml on gabrielguerrer/rava_driver_py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rng_rava-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: rng_rava-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 38.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rng_rava-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc4ddb5b050b7c049ec0a7300f3c6b718641d82be59ae770c19acdfc5bff9b15
MD5 23de13b55213105a2a808afcf8458d9a
BLAKE2b-256 e237bd10ccf981839b2d7d5cec47cb83185a1270c1bcdef7a202154475bbbcf5

See more details on using hashes here.

Provenance

The following attestation bundles were made for rng_rava-3.0.0-py3-none-any.whl:

Publisher: python-publish.yml on gabrielguerrer/rava_driver_py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page