v2ray-core/common/serial/hash.go

11 lines
168 B
Go

package serial
import "hash"
func WriteHash(h hash.Hash) func([]byte) (int, error) {
return func(b []byte) (int, error) {
h.Sum(b[:0])
return h.Size(), nil
}
}