import base64
import hashlib


def generate_hash(url):
    """
    Generates the hash value to be stored as key in the redis database
    """
    hashval = base64.urlsafe_b64encode(hashlib.md5(url).digest())
    hashval=hashval[0:6]
    
    return hashval