import hashlib
import base64


def binary_hash(binary):
    """
    Low collision hash of any binary string
    For designating the 16-char object key in Redis.
    Runs at 200 mu-second per hash on Macbook pro.
    Only contains characters from [a-z][A-Z]+_
    """
    s = hashlib.md5(binary).digest()
    s = base64.b64encode(s)[:16]
    s = s.decode('utf-8')
    # return s.replace('/','_')
    return s