From 6ae7554a508f6baed4c881cb7e60ff3dddd2456c Mon Sep 17 00:00:00 2001 From: AstaFrode Date: Mon, 30 Oct 2023 10:11:50 +0800 Subject: [PATCH] update cutfile --- chain/file.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)