diff --git a/chain/file.go b/chain/file.go index d8a4e58..f29e95e 100644 --- a/chain/file.go +++ b/chain/file.go @@ -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) @@ -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)