v2ray-core/common/serial/hash.go

15 lines
179 B
Go
Raw Normal View History

2016-12-06 10:03:42 +00:00
package serial
import (
"hash"
2016-12-09 10:35:27 +00:00
"v2ray.com/core/common/buf"
2016-12-06 10:03:42 +00:00
)
2016-12-09 10:35:27 +00:00
func WriteHash(h hash.Hash) buf.BytesWriter {
2016-12-06 10:03:42 +00:00
return func(b []byte) int {
h.Sum(b[:0])
return h.Size()
}
}