Sesame-iOS/Sesame/API/Extensions/Data+Coding.swift

12 lines
184 B
Swift
Raw Normal View History

2023-12-12 17:33:42 +01:00
import Foundation
extension Data {
init<T>(from value: T) {
var target = value
self = Swift.withUnsafeBytes(of: &target) {
Data($0)
}
}
}