A guide for converting v2 identifiers to data representations

JavaScript

var identifier = 'parrotbill';
var arr = [...s].map(s => s.charCodeAt());
var payload = new Uint8Array(arr);

Objective-C

NSString *identifier = [NSString stringWithUTF8String:@"parrotbill"];

NSData *payload = [identifier dataUsingEncoding:NSUTF8StringEncoding];

Python

The Chirp Connect Python SDK accepts string directly - so an identifier can be passed directly - but a similar conversion can be performed if needed.

identifier = 'parrotbill'
payload = [ord(ch) for ch in identifier]