Skip to content

Commit 77ca1ee

Browse files
authored
Merge pull request #10 from yann-soubeyrand/fix-type-cast
Expand multi-arch support by fixing type cast
2 parents c520523 + 14fb474 commit 77ca1ee

File tree

4 files changed

+11
-66
lines changed

4 files changed

+11
-66
lines changed

cgo/sha1.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,14 @@ func Sum(data []byte) ([]byte, bool) {
6565

6666
return d.sum()
6767
}
68+
69+
func (d *digest) Write(p []byte) (nn int, err error) {
70+
if len(p) == 0 {
71+
return 0, nil
72+
}
73+
74+
data := (*C.char)(unsafe.Pointer(&p[0]))
75+
C.SHA1DCUpdate(&d.ctx, data, (C.size_t)(len(p)))
76+
77+
return len(p), nil
78+
}

cgo/sha1_nix.go

Lines changed: 0 additions & 22 deletions
This file was deleted.

cgo/sha1_nix_armhf.go

Lines changed: 0 additions & 22 deletions
This file was deleted.

cgo/sha1_windows.go

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)