GeneratorProtocol
@available(iOS 13.0, OSX 10.15, watchOS 6.0, tvOS 13.0, *)
public protocol GeneratorProtocolA type that can represent a generator for a given type of one-time password
This object is used for validation as well as storage for the actual algorithm generation data
- 
                  validateDigits(_:)Default implementationValidates the number of digits to generate the suggested number of digits is 6-8, as stated by RFC6238. Default ImplementationDeclarationSwift static func validateDigits(_ digits: Int) throwsParametersdigitsThe length of the code to be generated 
- 
                  validateGeneratorAlgorithm(_:)Default implementationEnsure that the given generation algorithm is valid Default ImplementationCounter’s aren’t validated, but the period but be great than 0 So we do validate that. DeclarationSwift static func validateGeneratorAlgorithm(_ generatorAlgorithm: GeneratorAlgorithm) throwsParametersgeneratorAlgorithmThe generator algorithm to verify 
- 
                  validateTime(_:)Default implementationValidate that the requested time to generate a token against is not before the UNIXreference timeDefault ImplementationDeclarationSwift static func validateTime(_ timeSinceEpoch: TimeInterval) throwsParameterstimeSinceEpochTime since UNIX reference in seconds 
- 
                  validatePeriod(_:)Default implementationValidate often the token should change (should be a positive number) Default ImplementationDeclarationSwift static func validatePeriod(_ period: TimeInterval) throwsParametersperiodDuration of time in seconds 
- 
                  
                  A Base32shared secretDeclarationSwift var secret: Data { get }
- 
                  
                  The length of the code to be generated DeclarationSwift var digits: Int { get }
- 
                  
                  Generator algorithm being used DeclarationSwift var generatorAlgorithm: GeneratorAlgorithm { get }
- 
                  
                  Hash function being used DeclarationSwift var hashAlgorithm: SupportedHashAlgorithm { get }
- 
                  generate(with:)Default implementationCreates a one-time password Default ImplementationDeclarationSwift func generate(with date: Date) throws -> StringParametersdateSeed date to generate from, must be in the future 
 GeneratorProtocol Protocol Reference
        GeneratorProtocol Protocol Reference