{"id":23129028,"url":"https://github.com/twiny/dice","last_synced_at":"2026-02-18T09:30:16.836Z","repository":{"id":57638423,"uuid":"430652367","full_name":"twiny/dice","owner":"twiny","description":"random string/int generator for the Go language","archived":false,"fork":false,"pushed_at":"2021-11-22T10:46:23.000Z","size":3,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-31T02:04:30.317Z","etag":null,"topics":["golang","random-int","random-string"],"latest_commit_sha":null,"homepage":"","language":"Go","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/twiny.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}},"created_at":"2021-11-22T10:00:23.000Z","updated_at":"2024-11-04T10:44:24.000Z","dependencies_parsed_at":"2022-09-07T04:01:53.242Z","dependency_job_id":null,"html_url":"https://github.com/twiny/dice","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twiny%2Fdice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twiny%2Fdice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twiny%2Fdice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twiny%2Fdice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twiny","download_url":"https://codeload.github.com/twiny/dice/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239832399,"owners_count":19704607,"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":["golang","random-int","random-string"],"created_at":"2024-12-17T10:08:08.257Z","updated_at":"2026-02-18T09:30:16.778Z","avatar_url":"https://github.com/twiny.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Dice - random string/int utility for the Go language\n\nThis package contains a random string and int generator. It is a wrapper around the crypto/rand package.\n\n**NOTE**: This package is provided \"as is\" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please [create a new issue](https://github.com/twiny/dice/issues/new).\n\n\n### Usage\n```\ngo get github.com/twiny/dice\n```\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/twiny/dice\"\n)\n\nfunc main() {\n\tfor i := 0; i \u003c 5; i++ {\n\t\tj := dice.RandInt(1, 234567890)\n\t\tfmt.Println(j)\n\t}\n\t//\n\n\tfor i := 0; i \u003c 5; i++ {\n\t\tj := dice.RandString(25)\n\t\tfmt.Println(j)\n\t}\n\n\t//\n\tfmt.Println(\"done :)\")\n}\n\n// Output:\n/*\n\t159191458\n\t40548335\n\t112436247\n\t211217306\n\t137384292\n\tEnZZq88MIR3sc4qUwJBHSkVmE\n\tQFYze2dCr1UP0czV62xzWX3eP\n\tUhIpkypBNe59LTZnQl9KkoxQk\n\ttyffLFt6y2B9TsZB0H0eoqH0C\n\tpCcAXLhqCOTN7w1htABSDEIfC\n\tdone :)\n*/\n```\n\n\n### Benchmark\n```\ngoos: darwin\ngoarch: amd64\npkg: dice\ncpu: Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz\nBenchmarkRandString-4   \t 1260508\t       945.0 ns/op\t      64 B/op\t       2 allocs/op\nBenchmarkRandInt-4      \t 1000000\t      1205 ns/op\t      56 B/op\t       4 allocs/op\nPASS\nok  \tdice\t3.493s\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwiny%2Fdice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwiny%2Fdice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwiny%2Fdice/lists"}