{"id":20424223,"url":"https://github.com/itpey/shinyid","last_synced_at":"2025-07-03T22:05:00.533Z","repository":{"id":198796132,"uuid":"671641395","full_name":"itpey/shinyid","owner":"itpey","description":"high-performance Go package inspired by Instagram's shortcode system for encoding and decoding unique identifiers into URL-safe 'shiny'","archived":false,"fork":false,"pushed_at":"2023-10-06T17:07:38.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T22:04:12.918Z","etag":null,"topics":["base64","decoding","encoding","facebook-api","go","go-lang","high-performance","instagram","instagram-api","instagram-private-api","meta","meta-api","shortcode","snowflake","threads","threads-api","threads-app","ulid","uuid"],"latest_commit_sha":null,"homepage":"https://github.com/itpey/shinyid","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itpey.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-07-27T19:43:40.000Z","updated_at":"2024-08-16T08:43:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"15fe0d83-9d44-43e4-a4cf-f8430e234923","html_url":"https://github.com/itpey/shinyid","commit_stats":null,"previous_names":["itpey/shinyid"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/itpey/shinyid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpey%2Fshinyid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpey%2Fshinyid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpey%2Fshinyid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpey%2Fshinyid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itpey","download_url":"https://codeload.github.com/itpey/shinyid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itpey%2Fshinyid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263410760,"owners_count":23462295,"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","decoding","encoding","facebook-api","go","go-lang","high-performance","instagram","instagram-api","instagram-private-api","meta","meta-api","shortcode","snowflake","threads","threads-api","threads-app","ulid","uuid"],"created_at":"2024-11-15T07:08:58.333Z","updated_at":"2025-07-03T22:05:00.498Z","avatar_url":"https://github.com/itpey.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ShinyID\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/itpey/shinyid.svg)](https://pkg.go.dev/github.com/itpey/shinyid)\n[![license](https://img.shields.io/github/license/itpey/shinyid)](https://github.com/itpey/shinyid/blob/main/LICENSE)\n\n## About\nShinyID is a high-performance Go package inspired by the Instagram shortcode system. It allows you to encode and decode unique identifiers (IDs) into a human-readable and URL-safe string format called 'shiny'. This package is designed for scenarios where speed and efficiency are crucial, making it ideal for applications that need to handle large volumes of encoded IDs.\n\n## Table of Contents\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Encoding (ID to Shiny)](#encoding-id-to-shiny)\n  - [Decoding (Shiny to ID)](#decoding-shiny-to-id)\n- [Example](#example) \n- [Benchmark Results](#benchmark-results)\n- [Running Tests](#running-tests)\n- [Running Benchmarks](#running-benchmarks)\n- [License](#license)\n- [Author](#author)\n\n## Features\n\n- **Efficient Encoding :** ShinyID offers a highly efficient method for converting numeric IDs into shiny strings.\n- **Lightning-Fast Decoding :** Decoding shiny strings into their original numeric IDs is optimized for speed and performance.\n- **URL-Safe :** Shiny strings are designed to be URL-safe, making them suitable for web applications.\n- **Inspired by Instagram :** The package draws inspiration from Instagram's shortcode system, ensuring a familiar and intuitive approach to representing IDs.\n\n## Installation\nTo integrate ShinyID into your Go project, you can easily install it using `go get`:\n\n```bash\ngo get github.com/itpey/shinyid\n```\n\n## Usage\n\n### Encoding (ID to Shiny)\n\nYou can quickly convert a numeric ID to its shiny representation using the ToShiny function:\n\n```go\nshiny := shinyid.ToShiny(9375)\n```\n\n### Decoding (Shiny to ID)\n\nTo decode a shiny string back into its original numeric ID, use the ToId function:\n\n```go\nid, err := shinyid.ToId(\"CSf\")\nif err != nil {\n    // Handle error\n}\n```\n\n## Example\nHere's a simple example showcasing the use of ShinyID:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/itpey/shinyid\"\n)\n\nfunc main() {\n\t// Encoding an ID to a shiny string\n\tshiny := shinyid.ToShiny(12345)\n\tfmt.Println(\"Shiny:\", shiny)\n\n\t// Decoding a shiny string back to an ID\n\tid, err := shinyid.ToId(shiny)\n\tif err != nil {\n\t\tfmt.Println(\"Error:\", err)\n\t} else {\n\t\tfmt.Println(\"ID:\", id)\n\t}\n}\n```\n\n## Benchmark Results\n\n### Benchmark results on an Intel Core i7-6700HQ CPU @ 2.60GHz:\n\n- **BenchmarkShinyIDEncoding :** ShinyID encoding took approximately **15.96** nanoseconds per operation.\n- **BenchmarkShinyIDDecoding :** ShinyID decoding took approximately **28.04** nanoseconds per operation.\n- **BenchmarkBase64Encoding :** base64 encoding took approximately **105.2** nanoseconds per operation.\n- **BenchmarkBase64Decoding :** base64 decoding took approximately **84.01** nanoseconds per operation.\n\nBased on these benchmark results, ShinyID significantly outperforms base64 encoding and decoding, especially in encoding operations. This performance advantage makes ShinyID an excellent choice for applications that require fast encoding and decoding of unique identifiers.\n\n## Running Tests\n\nTo run tests for ShinyID, use the following command:\n\n```bash\ngo test github.com/itpey/shinyid\n```\n## Running Benchmarks\n\nTo run benchmarks for ShinyID, use the following command:\n\n```bash\ngo test -bench=. github.com/itpey/shinyid\n```\n## License\nThis package is distributed under the Apache License, Version 2.0. See the [LICENSE](https://github.com/itpey/shinyid/blob/main/LICENSE) file for more details.\n\n## Author\nShinyID was created by [itpey](https://github.com/itpey).\n\\\nExperience the power and speed of ShinyID for your Go applications!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitpey%2Fshinyid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitpey%2Fshinyid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitpey%2Fshinyid/lists"}