serialize method

String serialize(
  1. Hmac hmac
)

Implementation

String serialize(Hmac hmac) {
  var headerString = base64Url.encode(json.encode(_header).codeUnits);
  var payloadString = base64Url.encode(json.encode(toJson()).codeUnits);
  var data = '$headerString.$payloadString';
  var signature = hmac.convert(data.codeUnits).bytes;
  return '$data.${base64Url.encode(signature)}';
}