WebSocketMaskingKey

public struct WebSocketMaskingKey

A single 4-byte websocket masking key.

WebSockets uses a masking key to prevent malicious users from injecting predictable binary sequences into websocket data streams. This structure provides a more convenient method of interacting with a masking key than simply by passing around a four-tuple.

  • Undocumented

    Declaration

    Swift

    public init?<T>(_ buffer: T) where T : Collection, T.Element == UInt8
  • Declaration

    Swift

    public static func ==(lhs: WebSocketMaskingKey, rhs: WebSocketMaskingKey) -> Bool
  • Declaration

    Swift

    public var startIndex: Int { get }
  • Declaration

    Swift

    public var endIndex: Int { get }
  • Declaration

    Swift

    public func index(after: Int) -> Int