{"id":17087667,"url":"https://github.com/nicksnyder/basen","last_synced_at":"2025-04-12T21:53:30.715Z","repository":{"id":44470748,"uuid":"182020238","full_name":"nicksnyder/basen","owner":"nicksnyder","description":"A base62 and base58 encoding library for Go","archived":false,"fork":false,"pushed_at":"2019-04-30T22:23:44.000Z","size":7,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T21:53:28.520Z","etag":null,"topics":["base58","base62","decoding","encoding","go"],"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/nicksnyder.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":"2019-04-18T05:12:06.000Z","updated_at":"2022-11-09T18:03:06.000Z","dependencies_parsed_at":"2022-08-24T18:31:39.439Z","dependency_job_id":null,"html_url":"https://github.com/nicksnyder/basen","commit_stats":null,"previous_names":["nicksnyder/base62"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicksnyder%2Fbasen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicksnyder%2Fbasen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicksnyder%2Fbasen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicksnyder%2Fbasen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicksnyder","download_url":"https://codeload.github.com/nicksnyder/basen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637834,"owners_count":21137538,"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":["base58","base62","decoding","encoding","go"],"created_at":"2024-10-14T13:34:30.277Z","updated_at":"2025-04-12T21:53:30.691Z","avatar_url":"https://github.com/nicksnyder.png","language":"Go","readme":"# basen\n\n[![GoDoc](http://godoc.org/github.com/nicksnyder/basen?status.svg)](http://godoc.org/github.com/nicksnyder/basen) [![Build Status](https://travis-ci.org/nicksnyder/basen.svg?branch=master)](http://travis-ci.org/nicksnyder/basen) [![codecov](https://codecov.io/gh/nicksnyder/basen/branch/master/graph/badge.svg)](https://codecov.io/gh/nicksnyder/basen) [![Report card](https://goreportcard.com/badge/github.com/nicksnyder/basen)](https://goreportcard.com/report/github.com/nicksnyder/basen)\n\nPackage basen implements a radix encoding/decoding scheme, defined by a n-character alphabet.\n\n```go\nimport \"github.com/nicksnyder/basen\"\n```\n\n## base62\n\nBase62 encoding encodes data using the character set `0-9A-Za-z`. It is useful for generating strings that are safe to include in URLs, and allows easy copy and paste because a double-click will usually select the whole string.\n\nEncode:\n\n```go\nencoded := basen.Base62Encoding.EncodeToString([]byte(\"Hello\"))\nfmt.Println(encoded) // 5TP3P3v\n```\n\nDecode:\n\n```go\ndecoded, _ := basen.Base62Encoding.DecodeString(\"5TP3P3v\")\nfmt.Println(string(decoded)) // Hello\n```\n\n## base58\n\n[Base58 encoding](https://en.wikipedia.org/wiki/Base58) is base62 encoding modified to avoid letters which might look ambiguous when printed (i.e. `0`, `O`, `I`, `l`). This reduces the risk of errors when a human is manually copying from some visual source.\n\nEncode:\n\n```go\nencoded := basen.Base58Encoding.EncodeToString([]byte(\"Hello\"))\nfmt.Println(encoded) // 9Ajdvzr\n```\n\nDecode:\n\n```go\ndecoded, _ := basen.Base58Encoding.DecodeString(\"9Ajdvzr\")\nfmt.Println(string(decoded)) // Hello\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicksnyder%2Fbasen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicksnyder%2Fbasen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicksnyder%2Fbasen/lists"}