示例#1
0
func (xx *xxHash64) Write(p []byte) (n int, err error) {
	switch {
	case xx.state == nil:
		return 0, ErrAlreadyComputed
	case len(p) > oneGb:
		return 0, ErrMemoryLimit
	}
	C.XXH64_update(xx.state, unsafe.Pointer(&p[0]), C.uint(len(p)))
	return len(p), nil
}
示例#2
0
func (xx *XXHash64) Write(p []byte) (n int, err error) {
	C.XXH64_update(&xx.state, unsafe.Pointer(&p[0]), C.size_t(len(p)))
	return len(p), nil
}