{"id":18137685,"url":"https://github.com/retrodev256/jitter_rng","last_synced_at":"2025-04-06T17:21:57.130Z","repository":{"id":260556116,"uuid":"881641776","full_name":"RetroDev256/jitter_rng","owner":"RetroDev256","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-02T00:56:16.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-12T23:26:35.376Z","etag":null,"topics":["zig","zig-library","zig-package"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RetroDev256.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-11-01T00:38:01.000Z","updated_at":"2024-11-02T00:56:20.000Z","dependencies_parsed_at":"2024-11-01T02:17:10.098Z","dependency_job_id":null,"html_url":"https://github.com/RetroDev256/jitter_rng","commit_stats":null,"previous_names":["retrodev256/jitter_rng"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RetroDev256%2Fjitter_rng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RetroDev256%2Fjitter_rng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RetroDev256%2Fjitter_rng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RetroDev256%2Fjitter_rng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RetroDev256","download_url":"https://codeload.github.com/RetroDev256/jitter_rng/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247518462,"owners_count":20951815,"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":["zig","zig-library","zig-package"],"created_at":"2024-11-01T15:05:56.886Z","updated_at":"2025-04-06T17:21:57.104Z","avatar_url":"https://github.com/RetroDev256.png","language":"Zig","readme":"# Say hello to easy-peasy true random!\n\nThis library exposes a std.Random interface and jitter() function -\nboth will use CPU timing jitter to generate random numbers.\n\nWe make the following assumptions:\n- Your system has a CPU that supports high resolution timers\n- Your system runs other processes at the same time as this one\n- Your system has a non-deterministic CPU scheduler\n- Your CPU is not some esoteric architecture\n\nWhile all of these assumptions must be held to ensure current theory,\nin many cases not all of them are necessary to gain true randomness.\n\nThese assumptions mean that the CPU's internal timer is not tied to\nthe current execution of the program. External variables such as CPU\nheat, the CPU frequency, the CPU scheduler, and even cache misses will\nfurther add entropy to the timings of when instructions occur.\n\nWe harvest this entropy simply by sampling the high resolution CPU timer.\n\n```\nramen:[retrodev]:~/repos/Zig/jitter_rng$ zig build run -Doptimize=ReleaseFast | RNG_test stdin\nRNG_test using PractRand version 0.95\nRNG = RNG_stdin, seed = unknown\ntest set = core, folding = standard(unknown format)\n\nrng=RNG_stdin, seed=unknown\nlength= 2 megabytes (2^21 bytes), time= 2.1 seconds\n  no anomalies in 111 test result(s)\n\nrng=RNG_stdin, seed=unknown\nlength= 4 megabytes (2^22 bytes), time= 6.2 seconds\n  no anomalies in 127 test result(s)\n\nrng=RNG_stdin, seed=unknown\nlength= 8 megabytes (2^23 bytes), time= 12.5 seconds\n  no anomalies in 139 test result(s)\n\nrng=RNG_stdin, seed=unknown\nlength= 16 megabytes (2^24 bytes), time= 24.4 seconds\n  no anomalies in 153 test result(s)\n\nrng=RNG_stdin, seed=unknown\nlength= 32 megabytes (2^25 bytes), time= 43.6 seconds\n  no anomalies in 169 test result(s)\n\nrng=RNG_stdin, seed=unknown\nlength= 64 megabytes (2^26 bytes), time= 82.5 seconds\n  no anomalies in 182 test result(s)\n\nrng=RNG_stdin, seed=unknown\nlength= 128 megabytes (2^27 bytes), time= 160 seconds\n  no anomalies in 199 test result(s)\n\nrng=RNG_stdin, seed=unknown\nlength= 256 megabytes (2^28 bytes), time= 313 seconds\n  no anomalies in 217 test result(s)\n\nrng=RNG_stdin, seed=unknown\nlength= 512 megabytes (2^29 bytes), time= 547 seconds\n  no anomalies in 232 test result(s)\n\n... And so on ...\n```\n\n### Disclaimer:\n\nPlease use battle-tested software, I provide no guaruntees whatsoever.\nIn the case that your computer doesn't support this high resolution timer,\nthe RNG may simply return 0 at all times. Beware.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretrodev256%2Fjitter_rng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretrodev256%2Fjitter_rng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretrodev256%2Fjitter_rng/lists"}