mirror of https://github.com/v2ray/v2ray-core
remove unnecessary memory allocation in vmess
parent
f7a152b871
commit
7881330644
|
@ -180,7 +180,9 @@ func (this *VMessRequest) ToBytes(timestampGenerator RandomTimestampGenerator, b
|
|||
idHash := IDHash(this.User.AnyValidID().Bytes())
|
||||
idHash.Write(timestamp.Bytes())
|
||||
|
||||
buffer.Append(idHash.Sum(nil))
|
||||
hashStart := buffer.Len()
|
||||
buffer.Slice(0, hashStart+16)
|
||||
idHash.Sum(buffer.Value[hashStart:hashStart])
|
||||
|
||||
encryptionBegin := buffer.Len()
|
||||
|
||||
|
|
Loading…
Reference in New Issue