{"id":24929603,"url":"https://github.com/nenosinc/geohasher","last_synced_at":"2026-04-24T21:31:19.609Z","repository":{"id":150987942,"uuid":"351668290","full_name":"nenosinc/Geohasher","owner":"nenosinc","description":"Convert raw coordinates to geohashes for use with Firebase, Google Maps, or other services where location querying may be used.","archived":false,"fork":false,"pushed_at":"2022-01-26T23:45:07.000Z","size":365,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-14T21:45:01.631Z","etag":null,"topics":["firebase","firestore","geohash","ios","location","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/nenosinc.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}},"created_at":"2021-03-26T05:06:31.000Z","updated_at":"2022-06-27T05:34:42.000Z","dependencies_parsed_at":"2024-02-24T15:58:50.140Z","dependency_job_id":null,"html_url":"https://github.com/nenosinc/Geohasher","commit_stats":null,"previous_names":["nenosinc/geohasher"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/nenosinc/Geohasher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nenosinc%2FGeohasher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nenosinc%2FGeohasher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nenosinc%2FGeohasher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nenosinc%2FGeohasher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nenosinc","download_url":"https://codeload.github.com/nenosinc/Geohasher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nenosinc%2FGeohasher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32241544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["firebase","firestore","geohash","ios","location","swift"],"created_at":"2025-02-02T13:43:39.305Z","updated_at":"2026-04-24T21:31:19.592Z","avatar_url":"https://github.com/nenosinc.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Geohasher\n\nA lovely, simple little Swift package to encode and decode geohashes for location-based queries.\n\n## What is a Geohash?\nGenerally speaking, the world is mapped using coordinates which identify can identify a specific point on the globe. Coordinates are just sets of numbers with varying levels of precision. Due to the nature of coordinates, it can be difficult to perform quick and efficient string matching queries, evaluate distance, or simply compare multiple locations.\n\n**Enter Geohashes**\n\nA geohash is an alphanumeric string with a minimum of 1 character and a maximum of 11 characters. \n\nThe length of the geohash string directly corresponds to its accuracy. For instance, a geohash of `ab1` may specify the entirety of New York City. But, a similar geohash with additional characters appended, such as `ab12345` may specify the Empire State Building.\n\nA geohash can be decoded *back* into its original coordinates to display information on a map. Or a coordinate can be encoded as a geohash for storage or evaluation.\n\nThe beauty of this whole system is that you only need to perform evaluations on a single data point, rather complex (and sometimes expensive) set comparisons. It's way easier to compare `abc123` to `def456` than it is to compare `35.1234567, -60.7654321` to `15.1234567, -70.7654321`.\n\n## Overview\nThis Swift Package is a lightweight solution that makes encoding and decoding geohashes blissfully easy.\n\nThere are two ways you can go about using this package:\n\n 1. Just add the `Geohash` package as a dependency on your project running Swift 5.3, iOS 13.0, or macOS 11.0 or later.\n 3. Or, there's a handy dandy shell script bundled in this repo. Go ahead -- download it and plug it into a project, automation, whatever your heart desires!\n\n## The Code\nEncoding a hash from coordinates is amazingly simple:\n\n```swift\nlet newHash = Geohasher.encode(latitude: 10.0000, longitude: -50.00000, length: 5)\n```\n\nDecoding a hash is even simpler:\n\n```swift\nlet coordinateTuple = Geohasher.decode(hash: \"hA5h\")\n```\n\nThere's also some handy helper functions on `CLLocationCoodinate2D`:\n\n```swift\nlet yourCoordinate: CLLocationCoordinate2D = CLLocationCoordinate2D(geohash: \"hA5h\")\nlet hashFromCoordinate = yourCoordinate.geohash(length: 4)\n```\n\nAdditionally, the `Geohasher.Precision` enum provides type-safe mappings (and inline documentation!) for the available hash lengths.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnenosinc%2Fgeohasher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnenosinc%2Fgeohasher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnenosinc%2Fgeohasher/lists"}