Skip to content
Snippets Groups Projects
Select Git revision
  • 6c43e710b11dffe1022fcc2aa7f0cea58ee0f368
  • main default protected
  • development
  • integration
  • v1.1.5
  • v1.1.4
  • v1.1.3
  • v1.1.2
  • v1.1.1
  • v1.1.0
  • v1.0.0
11 results

NewGroupChat.swift

Blame
  • PasswordGenerator.swift 551 B
    import Bindings
    
    public struct PasswordGenerator {
      public var run: (Int) -> Data
    
      public func callAsFunction(numBytes: Int = 32) -> Data {
        run(numBytes)
      }
    }
    
    extension PasswordGenerator {
      public static let live = PasswordGenerator { numBytes in
        guard let secret = BindingsGenerateSecret(numBytes) else {
          fatalError("BindingsGenerateSecret returned `nil`")
        }
        return secret
      }
    }
    
    #if DEBUG
    extension PasswordGenerator {
      public static let failing = PasswordGenerator { _ in
        fatalError("Not implemented")
      }
    }
    #endif