Skip to content

Commit

Permalink
update cutfile (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
AstaFrode authored Oct 30, 2023
1 parent 3861b97 commit 0d5f1b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chain/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func cutfile(file string) ([]string, error) {
if i+1 != segmentCount {
return segment, errors.New("read file err")
}
copy(buf[num:], make([]byte, pattern.SegmentSize-num))
copy(buf[num:], []byte(utils.RandStr(pattern.SegmentSize-num)))
}

hash, err := utils.CalcSHA256(buf)
Expand Down Expand Up @@ -228,7 +228,7 @@ func cutFileWithEncryption(file string) ([]string, error) {
if i+1 != segmentCount {
return segment, errors.New("read file err")
}
copy(buf[num:], make([]byte, segmentSize-num))
copy(buf[num:], []byte(utils.RandStr(segmentSize-num)))
}

hash, err := utils.CalcSHA256(buf)
Expand Down

0 comments on commit 0d5f1b3

Please sign in to comment.