1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-29 21:45:21 -05:00

writeHash

This commit is contained in:
Darien Raymond
2018-07-30 22:54:24 +02:00
parent 206f52affc
commit 8cfe77383f
2 changed files with 17 additions and 7 deletions

View File

@@ -88,13 +88,11 @@ func (c *ClientSession) EncodeRequestHeader(header *protocol.RequestHeader, writ
common.Must(buffer.AppendSupplier(buf.ReadFullFrom(rand.Reader, int32(padingLen))))
}
fnv1a := fnv.New32a()
common.Must2(fnv1a.Write(buffer.Bytes()))
common.Must(buffer.AppendSupplier(func(b []byte) (int, error) {
fnv1a.Sum(b[:0])
return fnv1a.Size(), nil
}))
{
fnv1a := fnv.New32a()
common.Must2(fnv1a.Write(buffer.Bytes()))
common.Must(buffer.AppendSupplier(serial.WriteHash(fnv1a)))
}
timestampHash := md5.New()
common.Must2(timestampHash.Write(hashTimestamp(timestamp)))