Difference between revisions of "The Algorithm"

From Geohashing
imported>Xkcd
imported>Tjtrumpet2323
Line 1: Line 1:
 
[[Image:Coordinates.png|thumb|301 px|The Algorithm]]
 
[[Image:Coordinates.png|thumb|301 px|The Algorithm]]
  
#The current date and the daily opening of the [[Dow Jones Industrial Average]] are fed through the [[wikipedia:MD5|MD5]] cryptographic algorithm.
+
'''This time, we ''did'' invent the algorithm!'''
#The resulting string is split in half and converted to decimal values less than one.
 
#The decimal values are tagged onto the end of the integer values of any given graticule to produce the geohash target.
 
  
== Hexadecimal to fractional-decimal calculation ==
+
#The current date and the daily opening of the [[Dow Jones Industrial Average]] are fed through the [[wikipedia:MD5|MD5]] cryptographic algorithm to generate as pseudo-random string of 32 hexadecimal digits.
 +
#The resulting string is split into two halves of 16 hexadecimal digits.
 +
#Each half-string is prepended with a decimal point (so as to represent a hexadecimal fraction) and is converted to a base-10 fraction.
 +
#The resulting decimal fractions are appended to the integral (lat,lon) values of any given [[graticule]] to produce that graticule's geohash target.
 +
 
 +
== Fractional hexadecimal to decimal calculation ==
 
Many online hex-to-dec converters do not support hexadecimal fractions.  Here is one that does:
 
Many online hex-to-dec converters do not support hexadecimal fractions.  Here is one that does:
 
* [http://www.easysurf.cc/cnver17.htm#bf16tobf10 EasySurf.cc]
 
* [http://www.easysurf.cc/cnver17.htm#bf16tobf10 EasySurf.cc]
 
<small>This time, we ''did'' invent the algorithm.</small>
 

Revision as of 19:26, 23 May 2008

The Algorithm

This time, we did invent the algorithm!

  1. The current date and the daily opening of the Dow Jones Industrial Average are fed through the MD5 cryptographic algorithm to generate as pseudo-random string of 32 hexadecimal digits.
  2. The resulting string is split into two halves of 16 hexadecimal digits.
  3. Each half-string is prepended with a decimal point (so as to represent a hexadecimal fraction) and is converted to a base-10 fraction.
  4. The resulting decimal fractions are appended to the integral (lat,lon) values of any given graticule to produce that graticule's geohash target.

Fractional hexadecimal to decimal calculation

Many online hex-to-dec converters do not support hexadecimal fractions. Here is one that does: