mirror of
https://github.com/minio/minio.git
synced 2026-11-28 15:31:49 +00:00
Now able to use crc32c and sha1 on Darwin, with OSX specific code
This commit is contained in:
1 parent
46eb2eaeb9
commit
856b7680df
11 files changed
+205
-20
No files matched your search
@@ -17,7 +17,7 @@
|
||||
package crc32c
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
"hash/crc32"
|
||||
)
|
||||
|
||||
@@ -35,7 +35,7 @@ func Sum32(buffer []byte) uint32 {
|
||||
|
||||
// Sum - io.Reader based crc helper
|
||||
func Sum(reader io.Reader) (uint32, error) {
|
||||
h := New()
|
||||
h := crc32.New(castanagoliTable)
|
||||
var err error
|
||||
for err == nil {
|
||||
length := 0
|
||||
@@ -45,7 +45,7 @@ func Sum(reader io.Reader) (uint32, error) {
|
||||
h.Write(byteBuffer)
|
||||
}
|
||||
if err != io.EOF {
|
||||
return nil, err
|
||||
return 0, err
|
||||
}
|
||||
return h.Sum32(), nil
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user