{"id":21674306,"url":"https://github.com/anhgelus/human-readable-slug","last_synced_at":"2025-08-30T16:13:12.115Z","repository":{"id":198197622,"uuid":"700253295","full_name":"anhgelus/human-readable-slug","owner":"anhgelus","description":"A little algorithm generating human readable slug in Go","archived":false,"fork":false,"pushed_at":"2024-05-06T12:38:00.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T08:46:51.477Z","etag":null,"topics":["algorithm","go","golang","slug"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anhgelus.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":"2023-10-04T08:41:22.000Z","updated_at":"2024-05-06T12:37:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"abf126ce-5fbb-435b-8167-f199b5d8c58d","html_url":"https://github.com/anhgelus/human-readable-slug","commit_stats":null,"previous_names":["anhgelus/human-readable-slug"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/anhgelus/human-readable-slug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anhgelus%2Fhuman-readable-slug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anhgelus%2Fhuman-readable-slug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anhgelus%2Fhuman-readable-slug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anhgelus%2Fhuman-readable-slug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anhgelus","download_url":"https://codeload.github.com/anhgelus/human-readable-slug/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anhgelus%2Fhuman-readable-slug/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272873291,"owners_count":25007503,"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","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"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":["algorithm","go","golang","slug"],"created_at":"2024-11-25T13:44:02.639Z","updated_at":"2025-08-30T16:13:12.093Z","avatar_url":"https://github.com/anhgelus.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Human Readable Slug\n\nLightweight Go library generating a human-readable slug by avoiding some bad combinations like:\n- I and l\n- 0 and O\n- m and n\n- or if letter1 = letter2\n\n## Usage\n\nTo install this library, run this command:\n```bash\ngo get -u github.com/anhgelus/human-readable-slug\n```\n\nAnd now you generate some slugs with the function `GenerateSlug` in `github.com/anhgelus/human-readable-slug`. E.g.:\n```go\nslug := GenerateSlug(time.Now().Unix(), 7) // generates a 7 chars-length slug with the current timestamp as seed \n```\n\nYou can also check if a slug is human-readable with the function `IsHumanReadable`. E.g.:\n```go\nIsHumanReadable(\"aab\") // returns false with the default options\nIsHumanReadable(\"Aab\") // returns true with the default options\n```\n\nIf you want to add a custom bad combination, you can use the function `AddBadCombination`.E.g.:\n```go\nAddBadCombination('b', 'd') // add the combination \"bd\" and \"db\"\nAddBadCombination('q', 'p') // add the combination \"qp\" and \"pq\"\n```\n### Customize\nIf you want to customize the options of the slug generation, you must use the `CustomSlug` type.\n- `HasCapitalLetters` is true if you want to have capital letters (default: true)\n- `HasNumbers` is true if you want to have numbers (default: true)\n- `CanBe2ConsecutiveLetters` is true if you want to have 2 consecutive letters or more (default: false)\n\nWith this type you can now call every other functions except the `AddBadCombination` which is global.\n```go\noptions := CustomSlug{\n    CanBe2ConsecutiveLetters: false,\n    HasNumbers:               false,\n    HasCapitalLetters:        true,\n}\noptions.GenerateSlug(time.Now().Unix(), 7) // Will generate a 7 chars length slug without numbers\noptions.IsHumanReadable(\"helloWorld\") // returns true\noptions.IsHumanReadable(\"hell0World\") // returns false due to the `0`\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanhgelus%2Fhuman-readable-slug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanhgelus%2Fhuman-readable-slug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanhgelus%2Fhuman-readable-slug/lists"}