{"id":23151121,"url":"https://github.com/4kills/base64encoding","last_synced_at":"2025-04-04T15:14:42.975Z","repository":{"id":57596516,"uuid":"148983371","full_name":"4kills/base64encoding","owner":"4kills","description":"Super fast base64 encoding/decoding library, supporting custom charsets. Written in pure go. ","archived":false,"fork":false,"pushed_at":"2020-07-16T23:57:17.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-10T00:44:04.848Z","etag":null,"topics":["base64","base64-decoding","base64-encoding","base64-urlsafe","compression","decompression","go","library"],"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/4kills.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":"2018-09-16T10:03:14.000Z","updated_at":"2021-05-20T03:01:08.000Z","dependencies_parsed_at":"2022-09-26T19:52:52.069Z","dependency_job_id":null,"html_url":"https://github.com/4kills/base64encoding","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4kills%2Fbase64encoding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4kills%2Fbase64encoding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4kills%2Fbase64encoding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4kills%2Fbase64encoding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4kills","download_url":"https://codeload.github.com/4kills/base64encoding/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247198466,"owners_count":20900081,"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":["base64","base64-decoding","base64-encoding","base64-urlsafe","compression","decompression","go","library"],"created_at":"2024-12-17T18:27:54.458Z","updated_at":"2025-04-04T15:14:42.958Z","avatar_url":"https://github.com/4kills.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# base64encoding\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA small but very efficient and fast base64 encoding/decoding library for go that offers a variety of default charsets but also the option \nto use your very own, user-defined charset.\n\n# Usage \n\nAn encoder is used for both, encoding and decoding. Every encoder you create is tied to its very own, immutable charset. \nThis ensures consistency when encoding/decoding with the same encoder. \n\n### Creating an Encoder:\n\nYou may create an encoder in one of the following ways:\n\n- encoder with the default charset that is **url-safe** but **non-standard**:\n  ```go \n  encoder := base64encoding.New()\n  ```\n- encoder with the **standard** base64 charset (e.g. used for encoding pictures in base64 in HTML) that is **not url-safe**:\n  ```go \n  encoder := base64encoding.NewWeb()\n  ```\n- encoder with a custom charset (or a constant of this library that wasn't given its own constructor) that is defined by the user. \n  Note that the charset must be comprised of exactly 64 pairwise distinct ASCII characters:\n  ```go \n  myCharset := base64encoding.EasilyReadableCodeSet  \n  // or myCharset := \"my_custoM-CharSeT+0123456789...\" (omitting the rest)\n  \n  encoder, err := base64encoding.NewCustom(myCharset)\n  if err != nil {\n    // handle error caused by illegal charset (e.g. not pairwise distinct)\n  }\n  ```\n  \nOnce you have created your encoder you may use it like that: \n\n### Encode:\n\n```go \ndata := []byte(\"some data: could be a picture, a UUID or whatever\") \nstringB64encoded := encoder.Encode(data) \n```\n\n### Decode:\n\n```go \ndata, err := encoder.Decode(stringB64encoded)\nif err != nil {\n  // handle error (e.g. string not encoded with the encoder's charset)\n}\n```\n\n# Notes\n\n- **encoders are thread-safe**. You may use the same encoder accross mutliple threads simultaneously, as the charset is read-only.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4kills%2Fbase64encoding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4kills%2Fbase64encoding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4kills%2Fbase64encoding/lists"}