def generateKey(password, bits=32):
    """
    Generates a new encryption key based on the inputted password.
    
    :param      password    | <str>
                bits        | <int>  | 16 or 32 bits
    
    :return     <str>
    """
    if bits == 32:
        hasher = hashlib.sha256
    elif bits == 16:
        hasher = hashlib.md5
    else:
        raise StandardError('Invalid hash type')

    return hasher(password).digest()
Generates a new encryption key based on the inputted password.
    
    :param      password    | <str>
                bits        | <int>  | 16 or 32 bits
    
    :return     <str>