{"id":16298841,"url":"https://github.com/ihexxa/randstr","last_synced_at":"2025-04-09T19:27:26.715Z","repository":{"id":55154277,"uuid":"314247700","full_name":"ihexxa/randstr","owner":"ihexxa","description":"Customizable random string generator in Go/Golang.","archived":false,"fork":false,"pushed_at":"2022-07-11T13:12:01.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-15T11:45:43.676Z","etag":null,"topics":["generator","go","golang","random-generation","random-str","random-string","seed"],"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/ihexxa.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":"2020-11-19T12:54:23.000Z","updated_at":"2024-04-26T13:08:12.000Z","dependencies_parsed_at":"2022-08-14T13:40:39.419Z","dependency_job_id":null,"html_url":"https://github.com/ihexxa/randstr","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihexxa%2Frandstr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihexxa%2Frandstr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihexxa%2Frandstr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ihexxa%2Frandstr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ihexxa","download_url":"https://codeload.github.com/ihexxa/randstr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248097218,"owners_count":21047189,"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":["generator","go","golang","random-generation","random-str","random-string","seed"],"created_at":"2024-10-10T20:45:43.512Z","updated_at":"2025-04-09T19:27:26.689Z","avatar_url":"https://github.com/ihexxa.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# randstr\n\n[![Build Status](https://travis-ci.org/ihexxa/q-radix.svg?branch=master)](https://travis-ci.org/ihexxa/q-radix)\n[![Go Report](https://goreportcard.com/badge/github.com/ihexxa/randstr)](https://goreportcard.com/report/github.com/ihexxa/randstr)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/ihexxa/randstr)](https://pkg.go.dev/github.com/ihexxa/randstr)\n\n_Customizable random string generator in Go/Golang._\n\n## Examples\n\nDocument is [here](https://pkg.go.dev/github.com/ihexxa/randstr).\n\n**Note**: This library should NOT be used in security-critical system.\n\n### Generate random strings with numbers/alphabets/alnums/candidates:\n\n```go\nimport \"github.com/ihexxa/randstr\"\n\n// customized generator\ncandidates := []string{\"你\", \"好\", \"世\", \"界\"}\nrandStr := randstr.New(candidates)\n\nfmt.Println(randStr.Gen()) // output could be: 世世界你你你你好\nfmt.Println(randStr.Alphabets())\nfmt.Println(randStr.Numbers())\nfmt.Println(randStr.Alnums())\n\n```\n\n### Generate fixed-length random strings:\n\n```go\nimport \"github.com/ihexxa/randstr\"\n\ncandidates := []string{\"你\", \"好\", \"世\", \"界\"}\nrandStr := randstr.New(candidates)\nrandStr.SetLenFixed(true) // set sample size fixed\nrandStr.SetLenMax(8) // set sample size to 8\n// above 3 lines can be replaced with randstr.NewRandstr(candidates, true, 8)\n\nfmt.Println(randStr.Gen())\n...\n\n```\n\n### Generate random slices:\n\n```go\nimport \"github.com/ihexxa/randstr\"\n\nrandStr := randstr.New([]string{\"你\", \"好\", \"世\", \"界\"})\n\nfmt.Println(randStr.GenSlice())\nfmt.Println(randStr.AlphabetSlice())\nfmt.Println(randStr.NumberSlice())\nfmt.Println(randStr.AlnumSlice())\n\n```\n\n### License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fihexxa%2Frandstr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fihexxa%2Frandstr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fihexxa%2Frandstr/lists"}