{"id":16834923,"url":"https://github.com/dchest/uniuri","last_synced_at":"2025-04-13T18:34:10.170Z","repository":{"id":45205654,"uuid":"1572735","full_name":"dchest/uniuri","owner":"dchest","description":"Go package uniuri generates random strings good for use in URIs to identify unique objects.","archived":false,"fork":false,"pushed_at":"2022-12-01T13:00:52.000Z","size":30,"stargazers_count":452,"open_issues_count":0,"forks_count":42,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-06T15:07:05.571Z","etag":null,"topics":["golang","random","random-string","secure","uuid"],"latest_commit_sha":null,"homepage":"","language":"Go","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/dchest.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-04-05T15:58:20.000Z","updated_at":"2025-03-15T23:41:11.000Z","dependencies_parsed_at":"2023-01-22T17:30:11.015Z","dependency_job_id":null,"html_url":"https://github.com/dchest/uniuri","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Funiuri","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Funiuri/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Funiuri/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dchest%2Funiuri/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dchest","download_url":"https://codeload.github.com/dchest/uniuri/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248760665,"owners_count":21157406,"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","random-string","secure","uuid"],"created_at":"2024-10-13T12:08:23.620Z","updated_at":"2025-04-13T18:34:10.127Z","avatar_url":"https://github.com/dchest.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Package uniuri\n=====================\n\n```go\nimport \"github.com/dchest/uniuri\"\n```\n\nPackage uniuri generates random strings good for use in URIs to identify\nunique objects.\n\nExample usage:\n\n```go\ns := uniuri.New() // s is now \"apHCJBl7L1OmC57n\"\n```\n\nA standard string created by New() is 16 bytes in length and consists of\nLatin upper and lowercase letters, and numbers (from the set of 62 allowed\ncharacters), which means that it has ~95 bits of entropy. To get more\nentropy, you can use NewLen(UUIDLen), which returns 20-byte string, giving\n~119 bits of entropy, or any other desired length.\n\nFunctions read from crypto/rand random source, and panic if they fail to\nread from it.\n\n\nConstants\n---------\n\n```go\nconst (\n\t// StdLen is a standard length of uniuri string to achive ~95 bits of entropy.\n\tStdLen = 16\n\t// UUIDLen is a length of uniuri string to achive ~119 bits of entropy, closest\n\t// to what can be losslessly converted to UUIDv4 (122 bits).\n\tUUIDLen = 20\n)\n\n```\n\n\n\nVariables\n---------\n\n```go\nvar StdChars = []byte(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\")\n```\n\n\nStdChars is a set of standard characters allowed in uniuri string.\n\n\nFunctions\n---------\n\n### func New\n\n```go\nfunc New() string\n```\n\nNew returns a new random string of the standard length, consisting of\nstandard characters.\n\n### func NewLen\n\n```go\nfunc NewLen(length int) string\n```\n\nNewLen returns a new random string of the provided length, consisting of\nstandard characters.\n\n### func NewLenChars\n\n```go\nfunc NewLenChars(length int, chars []byte) string\n```\n\nNewLenChars returns a new random string of the provided length, consisting\nof the provided byte slice of allowed characters (maximum 256).\n\n\n\nPublic domain dedication\n------------------------\n\nWritten in 2011-2014 by Dmitry Chestnykh\n\nThe author(s) have dedicated all copyright and related and\nneighboring rights to this software to the public domain\nworldwide. Distributed without any warranty.\nhttp://creativecommons.org/publicdomain/zero/1.0/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdchest%2Funiuri","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdchest%2Funiuri","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdchest%2Funiuri/lists"}