header method
The binding as length-prefixed fields.
Implementation
Uint8List header() {
final fields = [recipientPeerId, folderPath, messageId].map(_utf8).toList();
final out = BytesBuilder(copy: false);
for (final f in fields) {
if (f.length > _maxBindingField) {
throw ArgumentError('binding field exceeds $_maxBindingField bytes');
}
out.add([f.length >> 8, f.length & 0xff]);
out.add(f);
}
return out.toBytes();
}