{"id":23069059,"url":"https://github.com/microcontroleurmonde/esp32-c3_rng","last_synced_at":"2026-05-05T07:32:00.121Z","repository":{"id":268209114,"uuid":"903648546","full_name":"MicroControleurMonde/ESP32-C3_RNG","owner":"MicroControleurMonde","description":"A Micro-python library which provides an interface to generate a random number using the ESP32-C3's hardware RNG.","archived":false,"fork":false,"pushed_at":"2024-12-15T10:13:23.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T09:44:27.967Z","etag":null,"topics":["esp32-c3","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-15T07:00:32.000Z","updated_at":"2024-12-15T10:13:27.000Z","dependencies_parsed_at":"2024-12-15T08:26:55.008Z","dependency_job_id":null,"html_url":"https://github.com/MicroControleurMonde/ESP32-C3_RNG","commit_stats":null,"previous_names":["microcontroleurmonde/esp32-c3"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroControleurMonde%2FESP32-C3_RNG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroControleurMonde%2FESP32-C3_RNG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroControleurMonde%2FESP32-C3_RNG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MicroControleurMonde%2FESP32-C3_RNG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MicroControleurMonde","download_url":"https://codeload.github.com/MicroControleurMonde/ESP32-C3_RNG/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246981151,"owners_count":20863825,"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":["esp32-c3","micropython","rng","trng"],"created_at":"2024-12-16T06:12:47.461Z","updated_at":"2026-05-05T07:31:59.999Z","avatar_url":"https://github.com/MicroControleurMonde.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP32-C3 RNG\n---\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-C3's hardware RNG.\n\n\n## Under Construction ...\n\nA Micro-python library which provides an interface to generate a random number using the ESP32-C3'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-C3. It reads a random value from the '**RNG_DATA_REG**' register.\n\nThis uses the same method to generate random numbers as the ESP32. Only the registry address changes (***0x600260B0***)\n\n- Library : **esp32_c6_rng.py**\n- Library test: **test_esp32_c6_rng.py**\n\n**Source**: *`ESP32-C3 Technical Reference Manual V.1.1 - Chapter 25 Random Number Generator (RNG) - Pages 528/529`* -  [link](https://www.espressif.com/sites/default/files/documentation/esp32-c3_technical_reference_manual_en.pdf)\n\nThe ESP32-C6 RNG generates random integer numbers as **32-bit values**.\n\n    Random value #1: \t146820682\n    Random value #2: \t-196285670\n    Random value #3: \t-866286180\n    Random value #4: \t-1000580641\n    Random value #5: \t1642066338\n    Random value #6: \t-1467530287\n    Random value #7: \t-697217448\n    Random value #8: \t-1944603219\n    Random value #9: \t1952318979\n    Random value #10: \t1012424606\n\n## Platform\nThe code was implemented specifically for an Espressif ESP32-C3 microcontroller on a Seeed Studio XIAO ESP32C3 Module [Link](https://www.seeedstudio.com/Seeed-XIAO-ESP32C3-p-5431.html?srsltid=AfmBOoo0va9xPKzG-zCuRxoFXjVCC8uy9bMNLPEuQdSVxHsAHfRzhXAA)\n\nEsptool indicates ESP32-C3 (QFN32) (revision v0.4)\n\nQuad Flat No-lead 32 pins (QFN32).\n\n    MicroPython v1.22.2 on 2024-02-22; ESP32C3 module with ESP32C3\n\n## Performance\n\nTime taken to generate xxxxxx values: **xx** seconds (avg)\n\nThroughput: **xxxxxx** bytes/sec\n\n**xxxxx** random values / sec.\n\n        Time taken to generate 8000 values: 837 seconds\n        Throughput: 38.23 bytes/sec\n        Number of random values per second: 9.56\n        \n        Needless to say, it is rather slow !\n        Clearly, the adoption of HP SRAM on the C6 has greatly improved things compared to the SRAM on the C3 in terme of latency.\n\n## Ent Test Report\n\n  ([www.fourmilab.ch](https://www.fourmilab.ch/random/)) John Walker\n- Sample size: **xx MB**\n- Total generated: **xxxxxx** values\n\nMy first attempt to generate random values gives on 44446 numbers, an entropy of **3.555333** bits per byte.  although the MCU is slow, it fulfills its task perfectly.\n\n## Dieharder Test Report\n\n(https://webhome.phy.duke.edu/~rgb/General/dieharder.php) Robert G. Brown\n\nSample size: **xx MB**\n\nTotal generated: **xxxxxxx** values\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrocontroleurmonde%2Fesp32-c3_rng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrocontroleurmonde%2Fesp32-c3_rng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrocontroleurmonde%2Fesp32-c3_rng/lists"}