{"id":16759548,"url":"https://github.com/cyrildever/base62","last_synced_at":"2025-06-26T02:04:07.648Z","repository":{"id":53758065,"uuid":"347334432","full_name":"cyrildever/base62","owner":"cyrildever","description":"Custom Base-62 Encoder","archived":false,"fork":false,"pushed_at":"2025-01-26T16:33:59.000Z","size":851,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-18T09:06:29.964Z","etag":null,"topics":["base-62","go","golang","library","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/cyrildever.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,"zenodo":null}},"created_at":"2021-03-13T10:02:41.000Z","updated_at":"2025-02-14T11:52:59.000Z","dependencies_parsed_at":"2023-02-02T07:46:51.090Z","dependency_job_id":"58ecdbad-c9b6-4dad-a820-e5ba85836c27","html_url":"https://github.com/cyrildever/base62","commit_stats":{"total_commits":55,"total_committers":3,"mean_commits":"18.333333333333332","dds":0.2909090909090909,"last_synced_commit":"60a219180a3cb723c219a169b15acf3c5d3199fe"},"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/cyrildever/base62","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrildever%2Fbase62","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrildever%2Fbase62/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrildever%2Fbase62/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrildever%2Fbase62/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cyrildever","download_url":"https://codeload.github.com/cyrildever/base62/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cyrildever%2Fbase62/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261984650,"owners_count":23240303,"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":["base-62","go","golang","library","typescript"],"created_at":"2024-10-13T04:08:25.231Z","updated_at":"2025-06-26T02:04:07.617Z","avatar_url":"https://github.com/cyrildever.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# base62\n_Custom Base-62 Encoder_\n\n![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/cyrildever/base62)\n![GitHub last commit](https://img.shields.io/github/last-commit/cyrildever/base62)\n![GitHub issues](https://img.shields.io/github/issues/cyrildever/base62)\n![npm](https://img.shields.io/npm/dw/base62)\n![NPM](https://img.shields.io/npm/l/base62)\n\nThis repository contains the version of my encoder/decoder for Base-62 in three languages:\n* [Golang](go/);\n* [Python](py/);\n* [TypeScript](ts/).\n\nThe latter could be downloaded from its NPM repo: [https://www.npmjs.com/package/base62-ts](https://www.npmjs.com/package/base62-ts).\n\n\n### Motivation\n\nI needed an efficient way to apply a Base-62 encoding/decoding algorithm working the same way in TypeScript/Javascript, Python and Golang environments.\n\n_**WARNING**: Decoding any wrongful string returns an error and `0`. You shouldn't use the latter._\n\n\n### Usage\n\nBoth versions use the same following dictionary:\n\n| Value | Character | Value | Character | Value | Character | Value | Character | Value | Character |\n|:-----:|:---------:|:-----:|:---------:|:-----:|:---------:|:-----:|:---------:|:-----:|:---------:|\n|   0   |    `0`    |   13  |    `d`    |   26  |    `q`    |   39  |    `D`    |   52  |    `Q`    |\n|   1   |    `1`    |   14  |    `e`    |   27  |    `r`    |   40  |    `E`    |   53  |    `R`    |\n|   2   |    `2`    |   15  |    `f`    |   28  |    `s`    |   41  |    `F`    |   54  |    `S`    |\n|   3   |    `3`    |   16  |    `g`    |   29  |    `t`    |   42  |    `G`    |   55  |    `T`    |\n|   4   |    `4`    |   17  |    `h`    |   30  |    `u`    |   43  |    `H`    |   56  |    `U`    |\n|   5   |    `5`    |   18  |    `i`    |   31  |    `v`    |   44  |    `I`    |   57  |    `V`    |\n|   6   |    `6`    |   19  |    `j`    |   32  |    `w`    |   45  |    `J`    |   58  |    `W`    |\n|   7   |    `7`    |   20  |    `k`    |   33  |    `x`    |   46  |    `K`    |   59  |    `X`    |\n|   8   |    `8`    |   21  |    `l`    |   34  |    `y`    |   47  |    `L`    |   60  |    `Y`    |\n|   9   |    `9`    |   22  |    `m`    |   35  |    `z`    |   48  |    `M`    |   61  |    `Z`    |\n|   10  |    `a`    |   23  |    `n`    |   36  |    `A`    |   49  |    `N`    |       |           |\n|   11  |    `b`    |   24  |    `o`    |   37  |    `B`    |   50  |    `O`    |       |           |\n|   12  |    `c`    |   25  |    `p`    |   38  |    `C`    |   51  |    `P`    |       |           |\n\nIn other words, they use the following base: `0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`.\n\nFor TypeScript:\n```console\nnpm i base62-ts\n```\n\n```typescript\nimport * as base62 from 'base62-ts'\n\nconst value = 18969\n\nconst encoded = base62.encode(value)\n\n// 4VX\nconsole.log(encoded)\n\nconst decoded = base62.decode(encoded)\n\nconsole.assert(value === decoded)\n```\n\nFor Go:\n```console\ngo get github.com/cyrildever/base62\n```\n\n```golang\nimport \"github.com/cyrildever/base62\"\n\nvalue := \"4VX\"\n\ndecoded, err := base62.Decode(value)\n\n// 18969\nfmt.Println(decoded)\n\nencoded, err := base62.Encode(decoded)\n\nassert.Equal(t, value, encoded)\n```\n\nFor Python:\n```console\npip install base62-py\n```\n\n```python\nfrom base62 import decode, encode\n\nvalue = 18969\n\nencoded = encode(value)\n\n# 4VX\nprint(encoded)\n\ndecoded = decode(encoded)\n\nassert value == decoded\n```\n\n\n### License\n\nAll versions are available under a MIT license (see [LICENSE](LICENSE)).\n\n\n\u003chr /\u003e\n\u0026copy; 2021-2025 Cyril Dever. All rights reserved.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrildever%2Fbase62","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyrildever%2Fbase62","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyrildever%2Fbase62/lists"}