code: def hash_data(self, hash_input, algorithm="sha2-256", output_format="hex", mount_point=DEFAULT_MOUNT_POINT):
          
          if algorithm not in transit_constants.ALLOWED_HASH_DATA_ALGORITHMS:
              error_msg = 'invalid algorithm argument provided "{arg}", supported types: "{allowed_types}"'
              raise exceptions.ParamValidationError(error_msg.format(
                  arg=algorithm,
                  allowed_types=', '.join(transit_constants.ALLOWED_HASH_DATA_ALGORITHMS),
              ))
          if output_format not in transit_constants.ALLOWED_HASH_DATA_FORMATS:
              error_msg = 'invalid output_format argument provided "{arg}", supported types: "{allowed_types}"'
              raise exceptions.ParamValidationError(error_msg.format(
                  arg=output_format,
                  allowed_types=', '.join(transit_constants.ALLOWED_HASH_DATA_FORMATS),
              ))
          params = {
              'input': hash_input,
              'algorithm': algorithm,
              'format': output_format,
          }
          api_path = '/v1/{mount_point}/hash'.format(mount_point=mount_point)
          response = self._adapter.post(
              url=api_path,
              json=params,
          )
          return response.json()
docs: Return the cryptographic hash of given data using the specified algorithm.
  
          Supported methods:
              POST: /{mount_point}/hash(/{algorithm}). Produces: 200 application/json
  
          :param hash_input: Specifies the base64 encoded input data.
          :type hash_input: str | unicode
          :param algorithm: Specifies the hash algorithm to use. This can also be specified as part of the URL.
              Currently-supported algorithms are: sha2-224, sha2-256, sha2-384, sha2-512
          :type algorithm: str | unicode
          :param output_format: Specifies the output encoding. This can be either hex or base64.
          :type output_format: str | unicode
          :param mount_point: The "path" the method/backend was mounted on.
          :type mount_point: str | unicode
          :return: The JSON response of the request.
          :rtype: requests.Response