Reputation: 389
I tried using decimal and hexadecimal strings to create a CFDataRef
, but what I created not what I need. I need a CFDataRef
like "<b1a3c3 d4b5>
",
Here is my code:
CFDataRef abc = CFDataCreate(kCFAllocatorDefault, "b034958b0c6f",strlen("b034958b0c6f"));
CFDataRef abc = CFDataCreate(kCFAllocatorDefault, "4294967295", strlen("4294967295"));
Upvotes: 0
Views: 479
Reputation: 228
@kevin is correct, you need to pass the raw bytes.
UInt8 bytes[] = { 0xb1, 0xa3, 0xc3, 0xd4, 0xb5 };
CFDataRef abc = CFDataCreate(kCFAllocatorDefault, bytes, sizeof(bytes));
Upvotes: 1