CommonUtils

public class CommonUtils

Class with utility functions required in TK App or SDK.

    • Utility function that returns opaque bytes in Data format from HEX digits. *

    Declaration

    Swift

    public static func dataWithHexString(_ hex: String) -> Data

    Return Value

    Opaque bytes in Data format

    • Utility function that returns a String with the HEX digits from data. *

    Declaration

    Swift

    public static func hexadecimalString(_ data: Data) -> String

    Return Value

    Hexadecimal string

    • Calculate the SHA256 digest

    Declaration

    Swift

    public static func sha256(_ data: Data) -> Data

    Return Value

    32-byte SHA256 digest of data

  • Undocumented

    Declaration

    Swift

    public static func isValidEmail(email: String) -> Bool
  • Undocumented

    Declaration

    Swift

    public static func createQRFromString(_ str: String) -> CIImage
  • Decode Base64 or Base64-URL string to optional Data.

    Declaration

    Swift

    public static func decodeBase64(_ base64: String) -> Data?

    Parameters

    base64

    Base64 or Base64-URL encoded string.

    Return Value

    Decoded Data or nil on failure

  • Undocumented

    Declaration

    Swift

    public static func convertCIImageToCGImage(inputImage: CIImage) -> CGImage?
  • Undocumented

    Declaration

    Swift

    public static func getAuthMethodIconName(_ authMethod: AuthMethod) -> String
  • Undocumented

    Declaration

    Swift

    public static func getCategory(mItem: DocumentBase) -> String
  • Undocumented

    Declaration

    Swift

    public static func checkForUniversalLink(_ signatureRequest: WalletUtils.SignatureRequest, _ logger: Logger)
    • Utility function that returns an address String for the given serial number. *

    Declaration

    Swift

    public static func serialToAddress(_ serialNo: [UInt8]) -> String

    Return Value

    Hexadecimal address string