def hash_data(hash_):
 res = {}
 for (key, value) in hash_.items():
  if (type(value) in (str, unicode)):
   if (value == 'true'):
    value = True
   elif (value == 'false'):
    value = False
   elif (value == 'null'):
    value = None
   elif (value.isdigit() and (not re.match('^0[0-9]+', value))):
    value = int(value)
   elif re.match('^\\d{4}-\\d{2}-\\d{2}$', value):
    value = datetime.strptime(value, '%Y-%m-%d')
  res[key] = value
 return res

def hash_data ( hash_ ) : res = { } for ( key , value ) in hash_ . items ( ) : if ( type ( value ) in ( str , unicode ) ) : if ( value == 'true' ) : value = True elif ( value == 'false' ) : value = False elif ( value == 'null' ) : value = None elif ( value . isdigit ( ) and ( not re . match ( '^0[0-9]+' , value ) ) ) : value = int ( value ) elif re . match ( '^\\d{4}-\\d{2}-\\d{2}$' , value ) : value = datetime . strptime ( value , '%Y-%m-%d' ) res [ key ] = value return res
return the base64 encoded sha1 hash of the data .