Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Encode and decode hex strings
import Voltaire let bytes: [UInt8] = [0xde, 0xad, 0xbe, 0xef] let hex = Hex.encode(bytes) // "0xdeadbeef" let roundtrip = try Hex.decode(hex) XCTAssertEqual(roundtrip, bytes) // Foundation.Data support import Foundation let data = Data([0xca, 0xfe]) XCTAssertEqual(Hex.encode(data), "0xcafe")
Was this page helpful?
Suggestions