Instance Property
bytes
The bytes decoded from this hex string, lowercased before decoding.
- iOS 13.0+
- macCatalyst 13.0+
- macOS 10.15+
- tvOS 13.0+
- visionOS 1.0+
- watchOS 6.0+
var bytes: [UInt8] { get throws }
Discussion
Expects a string of even length containing only [0-9a-fA-F]. The lowercasing step is defensive — the underlying decoder is case-sensitive on its lowercase path — and means the input is rejected even if it contains ambiguous characters like non-ASCII digits.
Throws
ByteHexEncodingErrors.invalidHexString if the string contains non-hex characters; ByteHexEncodingErrors.invalidHexValue if the string has an odd length.