Skip to content

Instantly share code, notes, and snippets.

View KaQuMiQ's full-sized avatar

Kacper Kaliński KaQuMiQ

View GitHub Profile
@KaQuMiQ
KaQuMiQ / Unowned.swift
Created December 12, 2019 14:45
Dynamic unowned generic value
@propertyWrapper
internal final class Unowned<Wrapped> {
private let wrapper: Wrapper
fileprivate init(wrapper: Wrapper) {
self.wrapper = wrapper
}
internal var wrappedValue: Wrapped {
get { wrapper.get() }
@KaQuMiQ
KaQuMiQ / Cryptor.swift
Last active March 7, 2023 08:24
EasyAES
import Foundation
import CommonCrypto
internal enum CryptoError: Error {
case emptyData
case invalidData
case invalidKey
case fail(status: CCStatus)
}