#!/usr/bin/env python
# -*- coding: utf-8 -*-
def easyHash(s):
"""
MDSD used the following hash algorithm to cal a first part of partition key
"""
strHash = 0
multiplier = 37
for c in s:
strHash = strHash * multiplier + ord(c)
#Only keep the last 64bit, since the mod base is 100
strHash = strHash % (1<<64)
return strHash % 100 #Assume eventVolume is Large
print easyHash(u"àèìòù Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world!");
IyEvdXNyL2Jpbi9lbnYgcHl0aG9uCiMgLSotIGNvZGluZzogdXRmLTggLSotCgpkZWYgZWFzeUhhc2gocyk6CiAgICAiIiIKICAgIE1EU0QgdXNlZCB0aGUgZm9sbG93aW5nIGhhc2ggYWxnb3JpdGhtIHRvIGNhbCBhIGZpcnN0IHBhcnQgb2YgcGFydGl0aW9uIGtleQogICAgIiIiCiAgICBzdHJIYXNoID0gMAogICAgbXVsdGlwbGllciA9IDM3CiAgICBmb3IgYyBpbiBzOgogICAgICAgIHN0ckhhc2ggPSBzdHJIYXNoICogbXVsdGlwbGllciArIG9yZChjKQogICAgICAgICNPbmx5IGtlZXAgdGhlIGxhc3QgNjRiaXQsIHNpbmNlIHRoZSBtb2QgYmFzZSBpcyAxMDAKICAgICAgICBzdHJIYXNoID0gc3RySGFzaCAlICgxPDw2NCkgCiAgICByZXR1cm4gc3RySGFzaCAlIDEwMCAgI0Fzc3VtZSBldmVudFZvbHVtZSBpcyBMYXJnZQogICAgCnByaW50IGVhc3lIYXNoKHUiw6DDqMOsw7LDuSBIZWxsbyB3b3JsZCEgSGVsbG8gd29ybGQhIEhlbGxvIHdvcmxkISBIZWxsbyB3b3JsZCEgSGVsbG8gd29ybGQhIEhlbGxvIHdvcmxkISBIZWxsbyB3b3JsZCEiKTs=