This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cares | |
saree | |
sores | |
seres | |
bares | |
soree | |
soras | |
cores | |
sires | |
sared |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MyStruct: Decodable { | |
let data: Data | |
static func decodeHexData(_ decoder: Decoder) throws -> Data { | |
let container = try decoder.singleValueContainer() | |
let stringValue = try container.decode(String.self) | |
guard let data = Data(hexString: stringValue) else { | |
throw MyStructError.invalidHexString(stringValue) | |
} |
OlderNewer