{"id":13509336,"url":"https://github.com/alco/hashids-elixir","last_synced_at":"2025-12-11T23:39:33.830Z","repository":{"id":52835295,"uuid":"21336006","full_name":"alco/hashids-elixir","owner":"alco","description":"Stringify your ids","archived":false,"fork":false,"pushed_at":"2024-03-13T07:43:42.000Z","size":73,"stargazers_count":282,"open_issues_count":3,"forks_count":15,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-11-16T10:21:05.406Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/alco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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":"2014-06-30T01:13:08.000Z","updated_at":"2025-06-06T07:32:14.000Z","dependencies_parsed_at":"2024-05-01T18:19:00.114Z","dependency_job_id":"342fefd1-0a4a-4991-aa46-36e6c16af24a","html_url":"https://github.com/alco/hashids-elixir","commit_stats":{"total_commits":83,"total_committers":7,"mean_commits":"11.857142857142858","dds":"0.12048192771084343","last_synced_commit":"47641fea2d454749391d42463cf0824eb5852d48"},"previous_names":["alco/saltie"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/alco/hashids-elixir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alco%2Fhashids-elixir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alco%2Fhashids-elixir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alco%2Fhashids-elixir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alco%2Fhashids-elixir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alco","download_url":"https://codeload.github.com/alco/hashids-elixir/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alco%2Fhashids-elixir/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27672216,"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","status":"online","status_checked_at":"2025-12-11T02:00:11.302Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-01T02:01:06.352Z","updated_at":"2025-12-11T23:39:33.771Z","avatar_url":"https://github.com/alco.png","language":"Elixir","funding_links":[],"categories":["Text and Numbers"],"sub_categories":[],"readme":"Hashids\n=======\n\n[![Module Version](https://img.shields.io/hexpm/v/hashids.svg)](https://hex.pm/packages/hashids)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/hashids/)\n[![Total Download](https://img.shields.io/hexpm/dt/hashids.svg)](https://hex.pm/packages/hashids)\n[![License](https://img.shields.io/hexpm/l/hashids.svg)](https://github.com/alco/hashids-elixir/blob/master/LICENSE.md)\n[![Last Updated](https://img.shields.io/github/last-commit/alco/hashids-elixir.svg)](https://github.com/alco/hashids/commits/master)\n\n\nHashids lets you obfuscate numerical identifiers via reversible mapping.\n\nThis is a port of [Hashids][1] from JavaScript.\n\n  [1]: http://www.hashids.org/\n\n\n## Installation\n\nAdd Hashids as a dependency to your Mix project:\n\n```elixir\ndefp deps do\n  [\n    {:hashids, \"~\u003e 2.0\"}\n  ]\nend\n```\n\n## Usage\n\nHashids encodes a list of integers into a string (technically, iodata). Some of the encoding\nparameters can be customized.\n\n```elixir\ns = Hashids.new([\n  salt: \"123\",  # using a custom salt helps producing unique cipher text\n  min_len: 2,   # minimum length of the cipher text (1 by default)\n])\n\ncipher1 = Hashids.encode(s, 129)\n#=\u003e \"pE6\"\n\ncipher2 = Hashids.encode(s, [1,2,3,4])\n#=\u003e \"4bSwImsd\"\n\n# decode() always returns a list of numbers\n\nHashids.decode(s, cipher1)\n#=\u003e {:ok, [129]}\n\nHashids.decode!(s, cipher2)\n#=\u003e [1, 2, 3, 4]\n```\n\nIt is also possible to customize the character set used for the cipher text by\nproviding a custom alphabet. It has to be at least 16 characters long.\n\n```elixir\ndefmodule MyAccessToken do\n  @cyrillic_alphabet \"123456789абвгґдеєжзиіїйклмнопрстуфцчшщьюяАБВГҐДЕЄЖЗИІЇЙКЛМНОПРСТУФЦЧШЩЬЮЯ\"\n  @coder Hashids.new(alphabet: @cyrillic_alphabet)\n\n  def encode(token_ids) do\n    Hashids.encode(@coder, token_ids)\n  end\n\n  def decode(data) do\n    Hashids.decode(@coder, data)\n  end\nend\n\ndata = MyAccessToken.encode([1234, 786, 21, 0])\n#=\u003e \"ЦфюєИНаЛ1И\"\n\nMyAccessToken.decode(data)\n#=\u003e {:ok, [1234, 786, 21, 0]}\n```\n\n## Migrating from 1.0\n\nSee the [changelog](./CHANGELOG.md).\n\n## License\n\nThis software is licensed under [the MIT license](./LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falco%2Fhashids-elixir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falco%2Fhashids-elixir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falco%2Fhashids-elixir/lists"}