func (mh *MD5Hash) Write(msg []byte) (n int, err error) { size := C.size_t(len(msg)) if C.MD5_Update(&mh.md5, unsafe.Pointer(C.CString(string(msg))), size) != 1 { panic("problem updating hash") } return len(msg), nil }
func (d *digest) Write(msg []byte) (n int, err error) { size := C.size_t(len(msg)) if C.MD5_Update(&d.ctx, unsafe.Pointer(C.CString(string(msg))), size) != 1 { return 0, sslerr.Error() } return len(msg), nil }
func (d *digest) Write(p []byte) (nn int, err error) { if len(p) == 0 || C.MD5_Update(d.context, unsafe.Pointer(&p[0]), C.ulong(len(p))) == 1 { return len(p), nil } return 0, errors.New("MD5_Update failed") }
func (ctx *MD5Context) Update(data []byte) error { if len(data) == 0 { return nil } ret := C.MD5_Update((*C.MD5_CTX)(ctx), unsafe.Pointer(&data[0]), C.size_t(len(data))) if ret == 0 { return errors.New("Error during MD5 update") } return nil }
func (m *M) Write(data []byte) (n int, err error) { n = len(data) C.MD5_Update(m.ctx, unsafe.Pointer(&data[0]), C.size_t(n)) return }