ccri/geohash-java — pull request #8 by cne1x (2012-08-24 13:55:11+00:00)
Title: SPINOZA-1751 [geohash-java] Extend GeoHash to have a (relatively short) ...

...string representation that is valid for all bit-precision levels (not just those evenly divisible by 5)

Modified the encoding and decoding schemes, and added
a new unit test for the GeoHash class.

This encoding right-pads the GeoHash with 0s when its precision
is not already a multiple of 5 bits.

The implication is that round-trips through the encoding and
decoding process preserve the toBase32 string, but do not
preserve the GeoHash value itself. One way to recover the
original GeoHash from base-32 string is to do the following:
1. use the base-32 string to create a GeoHash
2. extract the substring of the GeoHash's binary string
that matches the length of the expected precision
3. use the extracted substring to initialize a new,
recovered GeoHash