refactor bytes functions

This commit is contained in:
v2ray committed 2016-06-26 22:34:48 +02:00
1 parent d12d5b0593
commit 67ac925ee7
16 files changed
+78 -64

No files matched your search

+1 -2
View File
@@ -29,8 +29,7 @@ func (this *SimpleAuthenticator) HeaderSize() int {
}
func (this *SimpleAuthenticator) Seal(buffer *alloc.Buffer) {
var length uint16 = uint16(buffer.Len())
buffer.Prepend(serial.Uint16ToBytes(length))
buffer.PrependUint16(uint16(buffer.Len()))
fnvHash := fnv.New32a()
fnvHash.Write(buffer.Value)