def dicthash(d): keys = kwargs.keys() keys.sort() return md5.new([str(d[k]) + str(k) for k in keys]).hexdigest()