Instance Property
hexString
The digest rendered as a 64-character lowercase hexadecimal string.
var hexString: String { get }
Return Value
A 64-character ASCII string. For raw byte access, use rawValue.
Mentioned In
Discussion
Each of the 32 bytes in rawValue is formatted as two hex digits with no separators, no 0x prefix, and no uppercase characters — the form consumed by JSON payloads, URL path segments, log lines, Git object IDs, JWT payload fingerprints, and Nostr NIP-01 event IDs.
Output length is always exactly 64 ASCII characters regardless of input size, because SHA-256 is a fixed-length digest per FIPS 180-4. The value is recomputed on each access; callers that need it hot in a tight loop should cache the result.
Note
The string matches the regex [0-9a-f]{64}. Use the stricter .allSatisfy(\.isHexDigit) check only if you also need to reject uppercase — Foundation’s isHexDigit accepts both cases.