{"id":19081177,"url":"https://github.com/namnv2496/go-consistent-hashing","last_synced_at":"2026-06-17T18:31:22.140Z","repository":{"id":257789036,"uuid":"833487309","full_name":"NamNV2496/go-consistent-hashing","owner":"NamNV2496","description":"A demonstration of consistent hashing.","archived":false,"fork":false,"pushed_at":"2024-07-25T06:47:34.000Z","size":91,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T06:11:56.456Z","etag":null,"topics":["basic-programming","consistent-hash-algorithm","consistent-hashing","demo-app","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NamNV2496.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-07-25T06:46:53.000Z","updated_at":"2024-07-26T15:33:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"79d8fb72-e634-40f0-9326-e33d5c51e329","html_url":"https://github.com/NamNV2496/go-consistent-hashing","commit_stats":null,"previous_names":["namnv2496/go-consistent-hashing"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NamNV2496/go-consistent-hashing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NamNV2496%2Fgo-consistent-hashing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NamNV2496%2Fgo-consistent-hashing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NamNV2496%2Fgo-consistent-hashing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NamNV2496%2Fgo-consistent-hashing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NamNV2496","download_url":"https://codeload.github.com/NamNV2496/go-consistent-hashing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NamNV2496%2Fgo-consistent-hashing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34461616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"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":["basic-programming","consistent-hash-algorithm","consistent-hashing","demo-app","golang"],"created_at":"2024-11-09T02:33:33.868Z","updated_at":"2026-06-17T18:31:22.118Z","avatar_url":"https://github.com/NamNV2496.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Consistent hashing\n\n## Add node and add key\n\n![alt text](image.png)\n\n## Delete a node\n\nAfter delete a node all key inside that node is moved to next node. And all added node after will route normally\n\n![alt text](image-1.png)\n\n### Log\n\u003cdetails\u003e\nPS F:\\GO_PROJECT\\go-consistent-hashing\u003e go run .\\main.go\n\n================================== Add Nodes ==========================================\n\nNode  1  Ip =  192.168.1.2  position =  39\n\nNode  2  Ip =  192.168.1.4  position =  86\n\nNode  3  Ip =  192.168.1.1  position =  92\n\n================================== Add keys ==========================================\n\nRoute key my-key, hash: 93 to begin node: 192.168.1.2\n\nKey my-key1 is routed hash 54 to server: 192.168.1.4\n\nKey my-key2 is routed hash 88 to server: 192.168.1.1\n\nKey my-key3 is routed hash 22 to server: 192.168.1.2\n\n================================= Print values in each node =========================================\n\nvalue in server 192.168.1.1:  map[88:{nguyễn văn a 15}]\n\nvalue in server 192.168.1.2:  map[22:highland 93:1]\n\nvalue in server 192.168.1.4:  map[54:phúc long]\n\n=================================== Remove a node 192.168.1.4 ====================================\n\ndistributeKeysOnRemovedNode 192.168.1.4 to next node 192.168.1.1Vlaue:  map[54:phúc long]\n\n========================== add  key again after remove ===================================\n\n========== Previous key ''my-key1' route to '192.168.1.4' ==========\n\n========== After remove node key ''my-key1' route to '192.168.1.1' ==========\n\nKey my-key5 is routed hash 59 to server: 192.168.1.1\n\nvalue in server 192.168.1.1:  map[54:phúc long 59:The coffee house 88:{nguyễn văn a 15}]\n\nvalue in server 192.168.1.2:  map[22:highland 93:1]\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamnv2496%2Fgo-consistent-hashing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnamnv2496%2Fgo-consistent-hashing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnamnv2496%2Fgo-consistent-hashing/lists"}