rust_qrng 0.1.0

Tsotchkes quantum random number generator library with cryptographic, financial, and gaming applications converted to Rust
Documentation

Tsotchke Quantum Random Number Generator (QRNG)

This project is a Rust library that implements Tsotchkes Quantum Random Number Generator (QRNG) along with various functionalities related to cryptography, finance, games, and statistical analysis. The library leverages quantum mechanics principles to generate random numbers, which can be used in various applications requiring high-quality randomness.

Features

  • Core Functionality: Implements the quantum random number generation logic.
  • Cryptography: Provides key exchange and key derivation algorithms utilizing quantum RNG.
  • Finance: Includes Monte Carlo simulations and options pricing models based on quantum RNG.
  • Games: Implements the logic for a quantum dice game.
  • Statistical Analysis: Contains statistical tests and validation functions to ensure the quality of randomness.

Getting Started

Prerequisites

  • Rust (version 1.60 or higher)
  • Cargo (Rust's package manager and build system)

Installation

To use this library in your project, add the following to your Cargo.toml:

[dependencies]
rust_qrng = { path = "../path_to_rust_qrng" }

Usage

Here is a simple example of how to use the QRNG library:

use rust_qrng::core::quantum_rng;

fn main() {
    let random_number = quantum_rng::generate_random_number();
    println!("Generated Quantum Random Number: {}", random_number);
}

Running Tests

To run the tests for this library, use the following command:

cargo test

Examples

Examples of how to use the various functionalities of the library can be found in the examples directory. You can run an example using:

cargo run --example quantum_dice_demo

Packaging and Publishing

Building for Release

After development, build the optimized release version:

cargo build --release

Packaging the Crate

Before publishing, package the crate to verify everything is included:

cargo package

To see what files will be included in the package:

cargo package --list

Publishing to Crates.io

  1. Get an API token from crates.io
  2. Login with your token:
    cargo login
    
  3. Publish the crate:
    cargo publish
    

Dry Run Publishing

To test publishing without actually uploading:

cargo publish --dry-run

Troubleshooting Packaging Issues

If you encounter packaging errors:

  1. Check required metadata - Ensure all fields in Cargo.toml are present
  2. Verify file permissions - Make sure all files are readable
  3. Check for missing files - Ensure LICENSE, README.md, and src/ exist
  4. Clean and retry:
    cargo clean
    cargo check
    cargo package --list
    

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue for any suggestions or improvements.

License

This project is licensed under the MIT License - see the LICENSE file for details.