Base64

public struct Base64

Base64 encoding.

  • Undocumented

    Declaration

    Swift

    public struct Base64
  • Use the Base64 algorithm as decribed by RFC 4648 section 4 to encode the input bytes. The alphabet specifies the translation table to use. RFC 4648 defines two such alphabets: - Standard (section 4) - URL and Filename Safe (section 5) - parameter bytes: Bytes to encode. - parameter alphabet: The Base64 alphabet to encode with. - returns: Base64 encoded ASCII bytes.

    Declaration

    Swift

    public static func encode(bytes: Data, alphabet: Alphabet = .Standard) -> Data

    Parameters

    bytes

    Bytes to encode.

    alphabet

    The Base64 alphabet to encode with.

    Return Value

    Base64 encoded ASCII bytes.

  • Base64 Alphabet to use during encoding. - Standard: The standard Base64 encoding, defined in RFC 4648 section 4. - URLAndFilenameSafe: The base64url encoding, defined in RFC 4648 section 5.

    See more

    Declaration

    Swift

    public enum Alphabet