constructPayload function

String constructPayload(
  1. Uint8List nonce,
  2. Uint8List ciphertext,
  3. Uint8List mac
)

Implementation

String constructPayload(Uint8List nonce, Uint8List ciphertext, Uint8List mac) {
  Uint8List payloadBytes = Uint8List.fromList([
    0x02, // Version
    ...nonce,
    ...ciphertext,
    ...mac,
  ]);
  return base64.encode(payloadBytes);
}