{"id":23692512,"url":"https://github.com/microcontroleurmonde/esp32-c6_rng","last_synced_at":"2026-04-27T11:31:15.250Z","repository":{"id":267832404,"uuid":"902497283","full_name":"MicroControleurMonde/ESP32-C6_RNG","owner":"MicroControleurMonde","description":"A Micro-python library which provides an interface to generate a random number using the ESP32-C6's hardware RNG.","archived":false,"fork":false,"pushed_at":"2024-12-13T15:03:28.000Z","size":1193,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-29T10:01:50.636Z","etag":null,"topics":["esp32-c6","micropython","rng","trng"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MicroControleurMonde.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-12T17:20:55.000Z","updated_at":"2024-12-18T18:32:46.000Z","dependencies_parsed_at":"2024-12-12T18:31:42.329Z","dependency_job_id":"fcb20b3e-dad6-4220-af5a-80a054f6027c","html_url":"https://github.com/MicroControleurMonde/ESP32-C6_RNG","commit_stats":null,"previous_names":["microcontroleurmonde/esp32-c6_rng"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MicroControleurMonde/ESP32-C6_RNG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroControleurMonde%2FESP32-C6_RNG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroControleurMonde%2FESP32-C6_RNG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroControleurMonde%2FESP32-C6_RNG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroControleurMonde%2FESP32-C6_RNG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MicroControleurMonde","download_url":"https://codeload.github.com/MicroControleurMonde/ESP32-C6_RNG/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroControleurMonde%2FESP32-C6_RNG/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32335295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["esp32-c6","micropython","rng","trng"],"created_at":"2024-12-30T03:28:34.886Z","updated_at":"2026-04-27T11:31:15.234Z","avatar_url":"https://github.com/MicroControleurMonde.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP32-C6 RNG\n\n![Link](https://github.com/MicroControleurMonde/ESP32_RNG/blob/main/Reports/ESP32download.jpg)\n\nA Micro-python library which provides an interface to generate a random number using the ESP32-C6's hardware RNG.\n\nThe code uses several hardware devices of the MCU to generate random noise values using additional entropy sources. The SAR ADC and Wi-Fi are exploited to provide quality inputs to the hardware random number generator integrated into the ESP32-C6 (FH4). It reads a random value from the **`LPPERI_RNG_DATA_REG`** register.\n\n- Library : **esp32_c6_rng.py**\n- Library test: **test_esp32_c6_rng.py**\n- Example: **Test_ESP32-C6_RNG.py**\n\n**Source**: *`ESP32-C6 Technical Reference Manual V.1.0 - Chapter 26 Random Number Generator (RNG) - Pages 705/706`* \n[Doc. Extract](https://github.com/MicroControleurMonde/ESP32-C6_RNG/blob/main/26.%20Random%20Number%20Generator%20(RNG).md)\n[PDF](https://github.com/MicroControleurMonde/ESP32-C6_RNG/blob/main/Misc/26%20Random%20Number%20Generator%20(RNG).pdf)\n\nThe ESP32-C6 RNG generates random integer numbers as **32-bit values**.\n\n                865254577\n                418491403\n                -1447893272\n                1205348786\n                -871015593\n                637462341\n                -725121184\n                -959320840\n                -2018839333\n                996041137\n\n## Platform\n\nThe code was implemented specifically for an Espressif ESP32-C6 microcontroller on a DFRobot Beetle ESP32-C6 development board [Link](https://www.dfrobot.com/product-2778.html?srsltid=AfmBOoobkIgBWxWnYV6HINjyG3PasT4rkkWpRrTADPIq6GYcCzJKCEQT)\n- Esptool indicates ESP32-C6FH4 chip revision v0.1\n- Quad Flat No-lead 32 pins (QFN32).\n\n        MicroPython v1.25.0-preview.114.gbdda91fe7 on 2024-12-11; ESP32C6 module with ESP32C6\n  \nDue to some difficulties to flash the card, the tested version is in \"*preview*\". By dint of playing with the registers, I generated several crash dumps...\n\n\n## Performance:\n\n- Time taken to generate 186'000 values: **67 seconds** (avg)\n- Throughput: **11031.11 bytes/sec**\n- **2757** random values / sec.\n\n                Note: Performance without saving date on file !\n                8000 values (beyond you will crash: \"MemoryError: memory allocation failed\")\n                Total time : 0.15 secondes\n                Throughput : 214765.09 bytes/sec\n                Random values : 53691.27 valeurs/sec\n\nTesting tools used:\n\n* Ent (28.01.2008)\n* Dieharder version 3.31.1\n\n## Ent Test Report \n  ([www.fourmilab.ch](https://www.fourmilab.ch/random/)) John Walker\n- Sample size: **2,0 MB**\n- Total generated: **186'000 values**\n\n- [Ent Report - Raw](https://github.com/MicroControleurMonde/ESP32-C6_RNG/blob/main/Reports/Ent_ESP32C6_RNG_186k.txt)\n- [Ent Report Analyse](https://github.com/MicroControleurMonde/ESP32-C6_RNG/blob/main/Reports/Ent_report_analyses.md)\n\n## Dieharder Test Report\n(https://webhome.phy.duke.edu/~rgb/General/dieharder.php) Robert G. Brown\n\n- Sample size: **2,0 MB**\n- Total generated: **186'000 values**\n\n- [Dieharder Report - Raw](https://github.com/MicroControleurMonde/ESP32-C6_RNG/blob/main/Reports/Dieharder_ESP32-C6_RNG_186k.txt)\n- [Dieharder Report Analyses](https://github.com/MicroControleurMonde/ESP32-C6_RNG/blob/main/Reports/Dieharder_Report_ESP32-C6_RNG_186k.md)\n---\n## Espressif statement:\n\nPage 705, at the bottom of the page:\n\n    \"A data sample of 2 GB, which is read from the random number generator at a rate of 5 MHz with only the\n    high-speed ADC being enabled, has been tested using the Dieharder Random Number Testsuite (version\n    3.31.1). The sample passed all tests.\"\n\nI admit that C code may offer better performance than micro-python... OK. \n\nBut physics is physics. And the mathematics associated with physical random phenomena is changeless.\n\nI am quite doubtful (_considering my own tests_) !\n\n# Special tribute:\n\n## Passing of John Walker\n\nWe are deeply saddened to hear of the passing of John Walker, one of the founders of Autodesk. He died at home in Switzerland, on 2nd February 2024, aged 74.\n\n[The announcement was shared here.](https://www.engineering.com/a-cad-legend-passes-autodesk-founder-john-walker-1949-to-2024/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrocontroleurmonde%2Fesp32-c6_rng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrocontroleurmonde%2Fesp32-c6_rng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrocontroleurmonde%2Fesp32-c6_rng/lists"}