{"id":21488610,"url":"https://github.com/yihleego/base62","last_synced_at":"2025-03-17T10:43:13.145Z","repository":{"id":61623585,"uuid":"531970620","full_name":"yihleego/base62","owner":"yihleego","description":"Base62 implementation for Go","archived":false,"fork":false,"pushed_at":"2022-09-14T06:56:23.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T00:51:32.686Z","etag":null,"topics":["base62","base64","codec","decoder","encoder"],"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/yihleego.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":"2022-09-02T15:00:10.000Z","updated_at":"2023-11-27T01:05:25.000Z","dependencies_parsed_at":"2022-10-19T18:45:19.772Z","dependency_job_id":null,"html_url":"https://github.com/yihleego/base62","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihleego%2Fbase62","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihleego%2Fbase62/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihleego%2Fbase62/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihleego%2Fbase62/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yihleego","download_url":"https://codeload.github.com/yihleego/base62/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244019706,"owners_count":20384805,"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":["base62","base64","codec","decoder","encoder"],"created_at":"2024-11-23T14:10:28.106Z","updated_at":"2025-03-17T10:43:13.124Z","avatar_url":"https://github.com/yihleego.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Base62\n\n[![GoDoc](https://godoc.org/github.com/yihleego/base62?status.svg)](https://godoc.org/github.com/yihleego/base62)\n[![Go Report Card](https://goreportcard.com/badge/github.com/yihleego/base62)](https://goreportcard.com/report/github.com/yihleego/base62)\n\nThe base62 encoding scheme uses 62 characters. The characters consist of the capital letters A-Z, the lower case letters a-z and the numbers 0–9. It is a binary-to-text encoding schemes that represent binary data in an ASCII string format.\n\n## Base62 Alphabet\n\n```\n0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\n```\n\n## Base62 table\n\n|Decimal|Binary|Base62| |Decimal|Binary|Base62| |Decimal|Binary|Base62| |Decimal|Binary|Base62|\n|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|\n|0|000000|0| |16|010000|G| |32|100000|W| |48|110000|m|\n|1|000001|1| |17|010001|H| |33|100001|X| |49|110001|n|\n|2|000010|2| |18|010010|I| |34|100010|Y| |50|110010|o|\n|3|000011|3| |19|010011|J| |35|100011|Z| |51|110011|p|\n|4|000100|4| |20|010100|K| |36|100100|a| |52|110100|q|\n|5|000101|5| |21|010101|L| |37|100101|b| |53|110101|r|\n|6|000110|6| |22|010110|M| |38|100110|c| |54|110110|s|\n|7|000111|7| |23|010111|N| |39|100111|d| |55|110111|t|\n|8|001000|8| |24|011000|O| |40|101000|e| |56|111000|u|\n|9|001001|9| |25|011001|P| |41|101001|f| |57|111001|v|\n|10|001010|A| |26|011010|Q| |42|101010|g| |58|111010|w|\n|11|001011|B| |27|011011|R| |43|101011|h| |59|111011|x|\n|12|001100|C| |28|011100|S| |44|101100|i| |60|111100|y|\n|13|001101|D| |29|011101|T| |45|101101|j| |61|111101|z|\n|14|001110|E| |30|011110|U| |46|101110|k| |  |     |  |\n|15|001111|F| |31|011111|V| |47|101111|l| |  |     |  |\n\nSee: [Wikipedia Base62](https://en.wikipedia.org/wiki/Base62)\n\n## Usage\n\n### Encode\n\n```go\nsrc := []byte(\"Hello, World!\")\nencoded := base62.StdEncoding.Encode(src)\n// {49, 119, 74, 102, 114, 122, 118, 100, 98, 116, 88, 85, 79, 108, 85, 106, 85, 102}\n```\n\n### EncodeToString\n\n```go\nsrc := []byte(\"Hello, World!\")\nencoded := base62.StdEncoding.EncodeToString(src)\n// 1wJfrzvdbtXUOlUjUf\n```\n\n### Decode\n\n```go\nsrc := []byte{49, 119, 74, 102, 114, 122, 118, 100, 98, 116, 88, 85, 79, 108, 85, 106, 85, 102}\ndecoded, err := base62.StdEncoding.Decode(src)\n// {72, 101, 108, 108, 111, 44, 32, 87, 111, 114, 108, 100, 33}\nstr := string(decoded)\n// Hello, World!\n```\n\n### DecodeString\n\n```go\nsrc := \"1wJfrzvdbtXUOlUjUf\"\ndecoded, err := base62.StdEncoding.DecodeString(src)\n// {72, 101, 108, 108, 111, 44, 32, 87, 111, 114, 108, 100, 33}\nstr := string(decoded)\n// Hello, World!\n```\n\n### Custom alphabet\n\n```go\n// 62-byte string\nencoding := base62.NewEncoding(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\")\n\nsrc := []byte(\"Hello, World!\")\nencoded := encoding.Encode(src)\n// {66, 54, 84, 112, 49, 57, 53, 110, 108, 51, 104, 101, 89, 118, 101, 116, 101, 112}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyihleego%2Fbase62","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyihleego%2Fbase62","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyihleego%2Fbase62/lists"}