Instance Property
bytes
The raw bytes of this value as a [UInt8] array, equivalent to withUnsafeBytes { Array($0) }.
var bytes: [UInt8] { get }
Discussion
Convenience accessor used throughout swift-secp256k1 to marshal arbitrary ContiguousBytes conformers (Data, [UInt8], SecureBytes, etc.) into a byte array for passing to upstream C functions that expect const unsigned char *. The copy is unavoidable when the upstream API requires a guaranteed-contiguous buffer with a known length.