def METHOD_NAME(
    self, value  # type: str
):
    if isinstance(self._access_key, AzureKeyCredential):
        decoded_secret = base64.b64decode(self._access_key.key)
    else:
        decoded_secret = base64.b64decode(self._access_key)
    digest = hmac.new(
        decoded_secret, value.encode("utf-8"), hashlib.sha256
    ).digest()
    return base64.b64encode(digest).decode("utf-8")