1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-23 02:26:49 -05:00
v2fly/common/serial/hash.go

11 lines
168 B
Go
Raw Normal View History

2016-12-06 05:03:42 -05:00
package serial
2016-12-09 07:17:34 -05:00
import "hash"
2016-12-09 05:35:27 -05:00
2016-12-09 07:17:34 -05:00
func WriteHash(h hash.Hash) func([]byte) (int, error) {
2016-12-09 06:08:25 -05:00
return func(b []byte) (int, error) {
2016-12-06 05:03:42 -05:00
h.Sum(b[:0])
2016-12-09 06:08:25 -05:00
return h.Size(), nil
2016-12-06 05:03:42 -05:00
}
}