Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
dhurley committed May 9, 2024
1 parent 32cd885 commit 5275787
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 60 deletions.
16 changes: 1 addition & 15 deletions sdk/checksum/checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ package checksum
import (
"crypto/sha256"
"fmt"
"math"

log "github.com/sirupsen/logrus"
)

// Checksum - calculate checksum from []byte
Expand All @@ -39,19 +36,8 @@ func Chunk(buf []byte, lim int) [][]byte {
return [][]byte{buf}
}

if lim <= 0 {
log.Error("Unable to chuck payload, chunk size is too small")
return [][]byte{}
}

chuckSize := bufSize / lim

if chuckSize > math.MaxInt64-1 {
log.Error("Unable to chuck payload, data too large")
return [][]byte{}
}
chunks := make([][]byte, 0)

chunks := make([][]byte, 0, chuckSize+1)
for len(buf) >= lim {
chunk, buf = buf[:lim], buf[lim:]
chunks = append(chunks, chunk)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5275787

Please sign in to comment.