kungfoo / geohash-java

Implementation of GeoHashes in java. We try to be/stay compliant to the spec, as far as possible.
Other
981 stars 310 forks source link

A question #35

Closed IrvingYan closed 5 years ago

IrvingYan commented 5 years ago

What does long firstFiveBitsMask = 0xf800000000000000l; mean?

kungfoo commented 5 years ago

It is a mask that selects the first five bits when used in a bitwise operation.

On Tue, Dec 18, 2018, 03:52 闫东 <notifications@github.com wrote:

What does long firstFiveBitsMask = 0xf800000000000000l; mean?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kungfoo/geohash-java/issues/35#issuecomment-448077946, or mute the thread https://github.com/notifications/unsubscribe-auth/AACgKMkuebASln2Aa3WOX0ucEdNmYYkbks5u6FhegaJpZM4ZXgLY .

kungfoo commented 5 years ago

You can see, five bits of the hash make up one character in the base32 encoding.

On Tue, Dec 18, 2018, 12:27 Silvio Heuberger <silvio.heuberger@gmail.com wrote:

It is a mask that selects the first five bits when used in a bitwise operation.

On Tue, Dec 18, 2018, 03:52 闫东 <notifications@github.com wrote:

What does long firstFiveBitsMask = 0xf800000000000000l; mean?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kungfoo/geohash-java/issues/35#issuecomment-448077946, or mute the thread https://github.com/notifications/unsubscribe-auth/AACgKMkuebASln2Aa3WOX0ucEdNmYYkbks5u6FhegaJpZM4ZXgLY .

kungfoo commented 5 years ago

I think that should answer your question. Please reopen if it's still unclear.

IrvingYan commented 5 years ago

thanks so much :)