Refactor SyncCore

This commit is contained in:
Peter
2019-10-21 16:58:00 +04:00
parent 75aa77faa8
commit 10692a323e
1162 changed files with 12205 additions and 10925 deletions

View File

@@ -0,0 +1,25 @@
import Postbox
public final class SecretChatEncryptionConfig: PostboxCoding {
public let g: Int32
public let p: MemoryBuffer
public let version: Int32
public init(g: Int32, p: MemoryBuffer, version: Int32) {
self.g = g
self.p = p
self.version = version
}
public init(decoder: PostboxDecoder) {
self.g = decoder.decodeInt32ForKey("g", orElse: 0)
self.p = decoder.decodeBytesForKey("p")!
self.version = decoder.decodeInt32ForKey("v", orElse: 0)
}
public func encode(_ encoder: PostboxEncoder) {
encoder.encodeInt32(self.g, forKey: "g")
encoder.encodeBytes(self.p, forKey: "p")
encoder.encodeInt32(self.version, forKey: "v")
}
}