Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hashing-algorithm for dates

What would be a good hash-algorithm to hash dates, e.g. 24/12/09 and 31/10/89?

The dates would range from about year 1950 to 2050.

Could using the unix timestamp somehow, be possible?

like image 769
Håkon Avatar asked Nov 04 '25 10:11

Håkon


1 Answers

You could use the number of days instead of the number of seconds since the start of the Unix Epoch. Just calculate:

<unix timestamp> / 86400
like image 165
Gumbo Avatar answered Nov 06 '25 04:11

Gumbo