{"id":19214921,"url":"https://github.com/fluuxio/random","last_synced_at":"2026-06-19T17:32:41.735Z","repository":{"id":146531978,"uuid":"115560299","full_name":"FluuxIO/random","owner":"FluuxIO","description":"Fast Random generators for use from single threaded data injection code","archived":false,"fork":false,"pushed_at":"2018-01-10T08:01:47.000Z","size":6,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-11-13T17:30:06.420Z","etag":null,"topics":["go","golang","performance"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FluuxIO.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":"2017-12-27T21:51:13.000Z","updated_at":"2017-12-29T15:08:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"24c156b8-9815-4938-aedd-49bb0c25e1ff","html_url":"https://github.com/FluuxIO/random","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/FluuxIO/random","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluuxIO%2Frandom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluuxIO%2Frandom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluuxIO%2Frandom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluuxIO%2Frandom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FluuxIO","download_url":"https://codeload.github.com/FluuxIO/random/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FluuxIO%2Frandom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34541892,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"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":["go","golang","performance"],"created_at":"2024-11-09T14:11:52.162Z","updated_at":"2026-06-19T17:32:41.699Z","avatar_url":"https://github.com/FluuxIO.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Random\n\nFast Random Generator for use from single threaded data injection code. It is especially useful if you\nneed to load test a service while generating random data. It that case, the random generator locks can\nbecome a bottleneck.\n\n## How to use\n\nYou first need to create a `RandomUnsafe` generator:\n\n```go\nr := random.NewRandomUnsafe()\n```\n\nYou will need to keep it as a reference. Please not that it is only safe to use from a single thread, but you can\ngenerate several `RandomUnsafe` values at the beginning of different Goroutines.\n\nYou can then call one of the available method to generate specific values.\n\nFor example, to generate an Int:\n\n```go\nr.Intn(100)\n```\n\nTo generate a variable length string between 15 and 20 characters:\n\n```go\nr.String(15, 25)\n```\n\n## Benchmark\n\nHere are a few example showing the gain \n\n```bash\n$ go test -bench .\ngoos: darwin\ngoarch: amd64\npkg: fluux.io/random\nBenchmarkRandString-4            2000000               808 ns/op\nBenchmarkRandomString-4         20000000                56.5 ns/op\nBenchmarkRandId-4                1000000              1665 ns/op\nBenchmarkRandomId-4              1000000              1053 ns/op\nBenchmarkRandInt-4              50000000                32.0 ns/op\nBenchmarkRandomInt-4            100000000               23.2 ns/op\nPASS\nok      fluux.io/random 10.386s\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluuxio%2Frandom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluuxio%2Frandom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluuxio%2Frandom/lists"}