def METHOD_NAME(self, pw: str) -> str:
    """
    Hash a user-defined password for RabbitMQ
    Parameters
    ----------
    pw: str
        The password for RabbitMQ
    Returns
    -------
    str
        Hashed password for RabbitMQ
    """
    # Generate a random 32 bit salt:
    salt = os.urandom(4)
    # Concatenate that with the UTF-8 representation of the password
    tmp0 = salt + pw.encode('utf-8')
    # Take the SHA256 hash and get the bytes back
    tmp1 = hashlib.sha256(tmp0).digest()
    # Concatenate the salt again:
    salted_hash = salt + tmp1
    # convert to base64 encoding:
    pass_hash = base64.b64encode(salted_hash)
    return pass_hash.decode('utf-8')