     func geohash(length: Int) -> String {
         return Geohash.encode(latitude: latitude, longitude: longitude, length: length)
     }
+    
+    func geohash(precision: Geohash.Precision) -> String {
+        return geohash(length: precision.rawValue)
+    }
 }
 
 #endif

        .map {
            ($1, String(integer: $0, radix: 2, padding: 5))
        }
        .reduce([Character:String]()) {
            var dict = $0
            dict[$1.0] = $1.1
            return dict
    }

    private static let charmap = bitmap
        .reduce([String:Character]()) {
            var dict = $0
            dict[$1.1] = $1.0
            return dict
    }
}


        guard bits.characters.count % 5 == 0 else { return nil }
        // bits = 1101000100101011011111010111100110010110101101101110001
        
        let (lat, lon) = bits.characters.enumerated().reduce(([Character](), [Character]())) {
            var result = $0
            if $1.0 % 2 == 0 {
                result.1.append($1.1)
