Skip to content

Commit

Permalink
fix: correct type cast error
Browse files Browse the repository at this point in the history
Closes #6
Closes #8
  • Loading branch information
yann-soubeyrand committed Dec 3, 2022
1 parent 6aedff0 commit 0771a15
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 66 deletions.
11 changes: 11 additions & 0 deletions cgo/sha1.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,14 @@ func Sum(data []byte) ([]byte, bool) {

return d.sum()
}

func (d *digest) Write(p []byte) (nn int, err error) {
if len(p) == 0 {
return 0, nil
}

data := (*C.char)(unsafe.Pointer(&p[0]))
C.SHA1DCUpdate(&d.ctx, data, (C.size_t)(len(p)))

return len(p), nil
}
22 changes: 0 additions & 22 deletions cgo/sha1_nix.go

This file was deleted.

22 changes: 0 additions & 22 deletions cgo/sha1_nix_armhf.go

This file was deleted.

22 changes: 0 additions & 22 deletions cgo/sha1_windows.go

This file was deleted.

0 comments on commit 0771a15

Please sign in to comment.