Skip to content

Number Generation written in pure C

License

Notifications You must be signed in to change notification settings

teleprint-me/lehmer.c

Repository files navigation

lehmer.c

Overview

Random Number Generators (RNGs) are foundational tools in numerous applications, including simulations, cryptography, games, and statistical sampling. The choice of RNG can significantly influence the performance and reliability of your projects. This repository aims to provide robust and efficient RNG implementations, with a focus on adaptability and maintainability.

Types of RNGs:

  1. Linear Congruential Generator (LCG): A simple and efficient pseudorandom number generator that uses a recursive formula. While commonly used, LCGs can have weaker statistical properties compared to more advanced generators.
  2. Mersenne Twister: Known for its excellent statistical properties, this RNG is widely used in scientific computing due to its ability to pass rigorous randomness tests.
  3. Discrete Fourier Transform (DFT) Generator: A deterministic RNG that leverages complex arithmetic and trigonometric functions. It offers strong security and reliability, making it ideal for high-security applications like cryptography, though it can be computationally intensive.

About lehmer.c

lehmer.c implements a Linear Congruential Generator in C, building upon the foundational work by Stephen Park and Derrick Lehmer. This project aims to refine and extend the LCG, offering a versatile and robust tool for various downstream applications.

Key Features:

  • Enhanced LCG Algorithm: Optimized for modern use cases, offering improved performance and usability.
  • Modular Design: Easily integrates with other projects, designed with maintainability and future extensions in mind.
  • Lightweight and Efficient: Prioritizes performance, suitable for resource-constrained environments.

Future Extensions

This repository is structured to potentially include other RNG implementations, such as the Mersenne Twister and Discrete Fourier Transform generators, providing a comprehensive suite of RNG tools in a single, easy-to-manage package.

Usage

To use the lehmer.c LCG in your project, simply include the source file and headers. Future extensions will be seamlessly integrated to allow for more complex RNG needs.

Dependencies

  • float_is_close.c: This module is a dependency for precise floating-point comparisons within the RNG algorithms.

References

Mathematical Background:

Original Papers:

Original Source Code:

License

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

About

Number Generation written in pure C

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published