diff --git a/quic/codec/Types.cpp b/quic/codec/Types.cpp index c7cd60758..d20c242b4 100644 --- a/quic/codec/Types.cpp +++ b/quic/codec/Types.cpp @@ -327,13 +327,8 @@ StreamTypeField StreamTypeField::Builder::build() { * associated data during aead encryption/decryption. */ Buf QuicAddrValidationToken::getPlaintextToken() const { - auto buf = std::make_unique(); - folly::io::Appender appender(buf.get(), sizeof(uint64_t)); - - // Write the timestamp - appender.writeBE(timestampInMs); - - return buf; + auto ts = folly::Endian::big(timestampInMs); + return folly::IOBuf::copyBuffer(&ts, sizeof(ts)); } Buf RetryToken::genAeadAssocData() const {