{"id":13482251,"url":"https://github.com/tobyapi/hash_ring","last_synced_at":"2026-01-16T22:15:16.014Z","repository":{"id":90265163,"uuid":"105663829","full_name":"tobyapi/hash_ring","owner":"tobyapi","description":"Implementation of Consistent Hash Ring for Crystal","archived":false,"fork":false,"pushed_at":"2018-06-23T02:52:26.000Z","size":22,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-22T22:07:06.703Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Crystal","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/tobyapi.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}},"created_at":"2017-10-03T14:47:39.000Z","updated_at":"2021-07-29T08:01:57.000Z","dependencies_parsed_at":"2024-01-14T19:13:11.753Z","dependency_job_id":null,"html_url":"https://github.com/tobyapi/hash_ring","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobyapi%2Fhash_ring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobyapi%2Fhash_ring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobyapi%2Fhash_ring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tobyapi%2Fhash_ring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tobyapi","download_url":"https://codeload.github.com/tobyapi/hash_ring/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222252115,"owners_count":16955967,"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":[],"created_at":"2024-07-31T17:01:00.300Z","updated_at":"2026-01-16T22:15:15.958Z","avatar_url":"https://github.com/tobyapi.png","language":"Crystal","readme":"[![Build Status](https://travis-ci.org/TobiasGSmollett/hash_ring.svg?branch=master)](https://travis-ci.org/TobiasGSmollett/hash_ring)\n\n# hash_ring\nThe Consistent Hash Ring is a useful data structure when you operate the distributed servers. This library is implementation of Consistent Hash Ring based on the excellent [Elixir hash ring lib](https://github.com/discordapp/ex_hash_ring).\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  hash_ring:\n    github: TobiasGSmollett/hash_ring\n```\n\n## Usage\n\n```crystal\nrequire \"hash_ring\"\n\n# Register 3 servers\nhash_ring = HashRing::HashRing.new([\"one\", \"two\", \"three\"])\n\n# Every user is assigned a server by consistent hash ring.\nhash_ring.get(\"user1\") # =\u003e \"three\"\nhash_ring.get(\"user2\") # =\u003e \"three\"\nhash_ring.get(\"user3\") # =\u003e \"one\"\nhash_ring.get(\"user4\") # =\u003e \"two\"\n\n# Removes the \"two\" server\nhash_ring.remove(\"two\")\n\n# Exists two servers which are \"one\" and \"three\".\nhash_ring.get(\"user1\") # =\u003e \"three\"\nhash_ring.get(\"user2\") # =\u003e \"three\"\nhash_ring.get(\"user3\") # =\u003e \"one\"\nhash_ring.get(\"user4\") # =\u003e \"three\"\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/TobiasGSmollett/hash_ring/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request\n\n## Contributors\n\n- [tobias](https://github.com/TobiasGSmollett) TobiasGSmollett - creator, maintainer\n","funding_links":[],"categories":["Algorithms and Data structures"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobyapi%2Fhash_ring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftobyapi%2Fhash_ring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftobyapi%2Fhash_ring/lists"}