String

extension String: LocalizedError
extension String: RequestStringConvertible

Extension - String

  • Calculate the HMAC digest of a string.

    Declaration

    Swift

    func hmac(algorithm: CryptoAlgorithm, key: Data) -> Data

    Parameters

    algorithm

    The cryptographic algorithm to use.

    key

    The key used to compute the HMAC, in Data format.

    Return Value

    The HMAC digest in Data format.

  • Compute the hash function of a string.

    Declaration

    Swift

    func hash(algorithm: CryptoAlgorithm) -> Data

    Parameters

    algorithm

    The cryptographic algorithm to use.

    Return Value

    The hash digest in Data format. This can then be converted to a base64 or hex string using the base64String or hexString extension methods.

  • Undocumented

    Declaration

    Swift

    public var requestString: String { get }
  • Undocumented

    Declaration

    Swift

    func replacing(prefix: String, with newPrefix: String) -> String
  • Returns the base64 representation of a string.

    Declaration

    Swift

    func base64EncodedString() -> String