{"id":16616903,"url":"https://github.com/sebastienrousseau/cmn","last_synced_at":"2025-03-28T01:19:56.849Z","repository":{"id":65769229,"uuid":"598332656","full_name":"sebastienrousseau/cmn","owner":"sebastienrousseau","description":"A Rust library for accessing a collection of mathematical and cryptographic constants","archived":false,"fork":false,"pushed_at":"2024-05-28T07:47:15.000Z","size":1519,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-29T19:11:08.270Z","etag":null,"topics":["avogadro","boltzmann","constants","cryptography","data-structures","development-tools","euler","gamma","golden-ratio","hash","mathematics","pi","planck","rust","silver-ratio","squareroot","tau"],"latest_commit_sha":null,"homepage":"http://doc.cmnlib.one/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebastienrousseau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"LICENSE-APACHE","code_of_conduct":".github/CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"sebastienrousseau","custom":"https://paypal.me/wwdseb"}},"created_at":"2023-02-06T22:12:37.000Z","updated_at":"2024-07-15T13:37:16.873Z","dependencies_parsed_at":"2024-05-09T20:42:41.443Z","dependency_job_id":"018e2a77-1672-420e-8354-e61ea4bbb69a","html_url":"https://github.com/sebastienrousseau/cmn","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"a4a68ee16bce1d18c9ef908f138869d69540d141"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fcmn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fcmn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fcmn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebastienrousseau%2Fcmn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebastienrousseau","download_url":"https://codeload.github.com/sebastienrousseau/cmn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245950097,"owners_count":20699009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avogadro","boltzmann","constants","cryptography","data-structures","development-tools","euler","gamma","golden-ratio","hash","mathematics","pi","planck","rust","silver-ratio","squareroot","tau"],"created_at":"2024-10-12T02:14:36.613Z","updated_at":"2025-03-28T01:19:56.831Z","avatar_url":"https://github.com/sebastienrousseau.png","language":"Rust","funding_links":["https://github.com/sponsors/sebastienrousseau","https://paypal.me/wwdseb"],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD033 MD041 --\u003e\n\n\u003cimg src=\"https://kura.pro/cmn/images/logos/cmn.svg\"\nalt=\"Common (CMN) logo\" height=\"261\" width=\"261\" align=\"right\" /\u003e\n\n\u003c!-- markdownlint-enable MD033 MD041 --\u003e\n\n# Common (CMN)\n\nA Rust library for accessing a collection of mathematical and cryptographic constants\n\n*Part of the [Mini Functions][00] family of libraries.*\n\n\u003c!-- markdownlint-disable MD033 MD041 --\u003e\n\u003ccenter\u003e\n\u003c!-- markdownlint-enable MD033 MD041 --\u003e\n\n![Common (CMN) Banner][banner]\n\n[![Made With Rust][made-with-rust-badge]][13] [![Crates.io][crates-badge]][08] [![Lib.rs][libs-badge]][10] [![Docs.rs][docs-badge]][09] [![License][license-badge]][02] [![Codecov][codecov-badge]][14]\n\n• [Website][01] • [Documentation][09] • [Report Bug][04] • [Request Feature][04] • [Contributing Guidelines][05]\n\n\u003c!-- markdownlint-disable MD033 MD041 --\u003e\n\u003c/center\u003e\n\u003c!-- markdownlint-enable MD033 MD041 --\u003e\n\n![divider][divider]\n\n## Overview 📖\n\n`Common (CMN)` is a modern, fast, and user-friendly library that makes it easy to access a wide range of mathematical and cryptographic constants.\n\n## Features ✨\n\nThe `Common (CMN)` uses the `serde` crate to serialize and deserialize the data.\n\nThe library has three modules:\n\n- **Macros**: This module contains functions for generating macros that can be used to access the constants and words.\n- **Constants**: This module contains the `Constants` structure, which provides a collection of constant values that are used throughout the library.\n- **Words**: This module contains the `Words` structure, which provides a collection of words that are used throughout the library.\n\n### Mathematical and Cryptographic Constants\n\nThe following table lists the most important mathematical and cryptographic constants available in the `Common (CMN)` library:\n\n| Constants | Description | Example |\n| --- | --- | --- |\n| APERY | Apéry's constant, which is the sum of the reciprocals of the positive cubes. `ζ(3) ≈ 1.2020569032` | Used in various mathematical calculations and series approximations. |\n| AVOGADRO | Avogadro's constant is the number of atoms or molecules in one mole of a substance. `N_A ≈ 6.02214076 x 10^23 mol^-1` | The number of atoms in 12 grams of carbon-12 is 6.02214076 × 10^23. This can be used to calculate the number of atoms or molecules in a given sample. |\n| BOLTZMANN | Boltzmann's constant is the physical constant relating the temperature of a system to the average kinetic energy of its constituent particles. `k_B ≈ 1.380648 x 10^-23 J K^-1` | The kinetic energy of an atom at room temperature is about 2.0 × 10^-21 joules. This can be used to calculate the temperature of a system, or to calculate the average kinetic energy of its particles. |\n| CATALAN | Catalan's constant, which is the sum of the alternating harmonic series. `C ≈ 0.915965594177219` | Used in various mathematical calculations and series approximations. |\n| COULOMB | Coulomb's constant, which is the proportionality constant in Coulomb's law. `k_e ≈ 8.9875517923` x 10^9 N m^2 C^-2 | Used in calculations related to electrostatic forces and electric fields. |\n| EULER | Euler's constant is a mathematical constant approximately equal to 2.71828. `e ≈ 2.7182818284590452353602874713527` | The sum of the infinite series 1 + 1/2 + 1/3 + ... is equal to Euler's constant, e. This can be used to calculate the sum of an infinite series, or to calculate the logarithm of a number. |\n| FARADAY | Faraday constant, which represents the amount of electric charge carried by one mole of electrons. `F ≈ 96485.33212 C mol^-1` | Used in calculations related to electrochemistry and electrolysis. |\n| GAMMA | The gamma constant is a mathematical constant approximately equal to 0.57721. `γ ≈ 0.5772156649015329` | The gamma function of 2 is equal to 1. This can be used to calculate the gamma function of a number, or to calculate the factorial of a number. |\n| GAS_CONSTANT | The gas constant, which relates the energy scale to the temperature scale in the ideal gas law. `R ≈ 8.314462618 J mol^-1 K^-1` | Used in calculations related to the behavior of gases and thermodynamics. |\n| GLAISHER_KINKELIN | Glaisher-Kinkelin constant, which arises in the asymptotic expansion of the Barnes G-function. `A ≈ 1.2824271291` | Used in various mathematical calculations and series approximations. |\n| GRAVITATIONAL_CONSTANT | The gravitational constant, which is the proportionality constant in Newton's law of universal gravitation. `G ≈ 6.67430 x 10^-11 m^3 kg^-1 s^-2` | Used in calculations related to gravitational forces and celestial mechanics. |\n| HASH_ALGORITHM | The hash algorithm used to generate the hash. The default is Blake3. | The hash of the string \"Hello, world!\" is 5eb63bbbe01eeed093cb22bb8f5acdc32790160b123138d53f2173b8d3dc3eee. This can be used to verify the integrity of data, or to create a unique identifier for a file. |\n| HASH_COST | The cost of the hash. | The hash cost of Blake3 is `2^128`. This can be used to determine how secure a hash algorithm is. |\n| HASH_LENGTH | The length of the hash. | The hash length of Blake3 is 32 bytes. This can be used to determine how much space is required to store the hash output. |\n| KHINCHIN | Khinchin's constant, which appears in the theory of continued fractions. `K ≈ 2.6854520010` | Used in various mathematical calculations and series approximations. |\n| PHI | The golden ratio is a number approximately equal to 1.618033988749895. `φ = (1 + √5) / 2 ≈ 1.6180339887498948482045868343656` | The golden ratio can be used to create a symmetrical design, or a design that is pleasing to the eye. |\n| Pi (π) | Pi is the ratio of a circle's circumference to its diameter. `π ≈ 3.14159265358979323846264338327950288` | The circumference of a circle with a radius of 1 is equal to pi. This can be used to calculate the circumference, area, and volume of circles, spheres, and other geometric shapes. |\n| PLANCK | Planck's constant, which relates the energy of a photon to its frequency. `h ≈ 6.62607015 x 10^-34 J s` | The energy of a photon of light with a wavelength of 500 nanometers is equal to Planck's constant multiplied by the frequency of the light. This can be used to calculate the energy of photons and other elementary particles. |\n| PLANCK_REDUCED | Planck's reduced constant, which is Planck's constant divided by 2π. `ħ = h / (2π) ≈ 1.054571817 x 10^-34 J s` | Used in quantum mechanics and related calculations. |\n| SILVER_RATIO | The silver ratio is one of the silver means. `δ_s = 1 + √2 ≈ 2.4142135623730950488016887242097` | The silver ratio can be used to create a symmetrical design, or a design that is pleasing to the eye. |\n| SPEED_OF_LIGHT | The speed of light in vacuum. `c ≈ 299792458 m s^-1` | Used in calculations related to relativity and electromagnetic phenomena. |\n| SPECIAL_CHARS | A set of special characters. | The special characters are: !@#$%^\u0026*()_+-={}[]|\\:;\"'\u003c\u003e,.?` |\n| SQRT2 | The square root of 2. `√2 ≈ 1.4142135623730950488016887242097` | The area of a circle with a radius of 1 is equal to the square root of 2. This can be used to calculate the area and volume of circles, spheres, and other geometric shapes. |\n| SQRT3 | The square root of 3. `√3 ≈ 1.7320508075688772935274463415059` | The area of a circle with a radius of 1 is equal to the square root of 3. This can be used to calculate the area and volume of circles. |\n| SQRT5 | The square root of 5. `√5 ≈ 2.23606797749979` | The area of a circle with a radius of 1 is equal to the square root of 5. |\n| TAU | The circle constant, which is the ratio of a circle's circumference to its radius. `τ = 2π ≈ 6.28318530717958647692528676655900577` | The circumference of a circle with a radius of 1 is equal to tau. |\n| VACUUM_PERMEABILITY | The vacuum permeability, which relates magnetic induction to magnetic field strength. `μ_0 ≈ 1.25663706212 x 10^-6 N A^-2` | Used in calculations related to electromagnetism and magnetic fields. |\n| VACUUM_PERMITTIVITY | The vacuum permittivity, which relates electric displacement to electric field strength. `ε_0 ≈ 8.8541878128 x 10^-12 F m^-1` | Used in calculations related to electromagnetism and electric fields. |\n\n## Getting Started 🚀\n\nIt takes just a few minutes to get up and running with `Common (CMN)`.\n\n### Installation\n\nTo install `Common (CMN)`, you need to have the Rust toolchain installed on your machine. You can install the Rust toolchain by following the instructions on the [Rust website][13].\n\nOnce you have the Rust toolchain installed, you can install `Common (CMN)` using the following command:\n\n```shell\ncargo install cmn\n```\n\n### Requirements\n\nThe minimum supported Rust toolchain version is currently Rust **1.60** or later (stable). It is recommended that you install the latest stable version of Rust.\n\n### Platform support\n\n`cmn` supports a variety of CPU architectures. It is supported and tested on MacOS, Linux, and Windows.\n\n\n### Documentation\n\n\u003e ℹ️ **Info:** Please check out our [website][01] for more information.\nYou can find our documentation on [docs.rs][09], [lib.rs][10] and [crates.io][08].\n\n## Usage 📖\n\nTo use the `Common (CMN)` library in your project, add the following to your `Cargo.toml` file:\n\n```toml\n[dependencies]\ncmn = \"0.0.4\"\n```\n\nAdd the following to your `main.rs` file:\n\n```rust\nextern crate cmn;\nuse cmn::*;\n```\n\nthen you can use the functions in your application code.\n\n### Examples\n\n`Common (CMN)` comes with a set of examples that you can use to get started. The examples are located in the `examples` directory of the project. To run the examples, clone the repository and run the following command in your terminal from the project root directory.\n\n```shell\ncargo run --example cmn\n```\n\n## Semantic Versioning Policy 🚥\n\nFor transparency into our release cycle and in striving to maintain backward compatibility, `Common (CMN)` follows [semantic versioning][07].\n\n## License 📝\n\n`Common (CMN)`is distributed under the terms of both the MIT license and the\nApache License (Version 2.0).\n\nSee [LICENSE-APACHE][02] and [LICENSE-MIT][03] for details.\n\n## Contribution 🤝\n\nWe welcome all people who want to contribute. Please see the [contributing instructions][05] for more information.\n\nContributions in any form (issues, pull requests, etc.) to this project must adhere to the [Rust's Code of Conduct][11].\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n\n## Acknowledgements 💙\n\nA big thank you to all the awesome contributors of the [Common (CMN) Library][06] for their help and support.\n\nA special thank you goes to the [Rust Reddit][12] community for providing a lot of useful suggestions on how to improve this project.\n\n[00]: https://cmnlib.com/ \"MiniFunctions\"\n[01]: https://cmnlib.one \"Common (CMN) Library Website\"\n[02]: https://opensource.org/license/apache-2-0/ \"Apache License, Version 2.0\"\n[03]: https://opensource.org/licenses/MIT \"MIT license\"\n[04]: https://github.com/sebastienrousseau/cmn/issues \"Issues\"\n[05]: https://github.com/sebastienrousseau/cmn/blob/main/CONTRIBUTING.md \"Contributing Instructions\"\n[06]: https://github.com/sebastienrousseau/cmn/graphs/contributors \"Contributors\"\n[07]: http://semver.org/ \"Semantic Versioning\"\n[08]: https://crates.io/crates/cmn \"Crates.io\"\n[09]: https://docs.rs/cmn \"Docs.rs\"\n[10]: https://lib.rs/crates/cmn \"Lib.rs\"\n[11]: https://www.rust-lang.org/policies/code-of-conduct \"Rust's Code of Conduct\"\n[12]: https://reddit.com/r/rust \"Rust Reddit\"\n[13]: https://www.rust-lang.org \"The Rust Programming Language\"\n[14]: https://codecov.io/gh/sebastienrousseau/cmn \"Codecov\"\n\n[banner]: https://kura.pro/cmn/images/titles/title-cmn.svg 'Common (CMN) banner'\n[codecov-badge]: https://img.shields.io/codecov/c/github/sebastienrousseau/cmn?style=for-the-badge\u0026token=0FZQGHLMOP 'Codecov'\n[crates-badge]: https://img.shields.io/crates/v/cmn.svg?style=for-the-badge 'Crates.io badge'\n[divider]: https://kura.pro/common/images/elements/divider.svg \"divider\"\n[docs-badge]: https://img.shields.io/docsrs/cmn.svg?style=for-the-badge 'Docs.rs badge'\n[libs-badge]: https://img.shields.io/badge/lib.rs-v0.0.4-orange.svg?style=for-the-badge 'Lib.rs badge'\n[license-badge]: https://img.shields.io/crates/l/cmn.svg?style=for-the-badge 'License badge'\n[made-with-rust-badge]: https://img.shields.io/badge/rust-f04041?style=for-the-badge\u0026labelColor=c0282d\u0026logo=rust 'Made With Rust badge'\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastienrousseau%2Fcmn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebastienrousseau%2Fcmn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebastienrousseau%2Fcmn/lists"}