0x11901
0x11901

Reputation: 389

What kind of CFDataRef is printed out like "<b1a3c3 d4b5>"?

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

Answers (1)

Leland Wallace
Leland Wallace

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

Related Questions