Skip to content

Instantly share code, notes, and snippets.

View s-c-p's full-sized avatar
🍄

S C P s-c-p

🍄
  • India
View GitHub Profile
@s-c-p
s-c-p / reducedDateRepresentation.py
Created March 26, 2017 11:52
An algorithm that assigns unique (values) hashes to all dates in an year.
import time, json
big = ["January", "March", "May", "July", "August", "October", "December"]
small = ["April", "June", "September", "November"]
class DateHasher(object):
""" duh... """
def __init__(self, dayMultiplier=12, monthMultiplier=31):
self.dayMultiplier = dayMultiplier