15 lines
190 B
Go
Raw Normal View History

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