From 3d8226c01bd07787fb1e72be531e69364371a14e Mon Sep 17 00:00:00 2001 From: AstaFrode Date: Fri, 24 Nov 2023 07:32:04 +0530 Subject: [PATCH] File changed to fixed padding (#163) --- chain/file.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chain/file.go b/chain/file.go index 341fdfc..f2fbaee 100644 --- a/chain/file.go +++ b/chain/file.go @@ -170,7 +170,7 @@ func cutfile(file string) ([]string, error) { if i+1 != segmentCount { return segment, errors.New("read file err") } - copy(buf[num:], []byte(utils.RandStr(pattern.SegmentSize-num))) + copy(buf[num:], make([]byte, pattern.SegmentSize-num, pattern.SegmentSize-num)) } hash, err := utils.CalcSHA256(buf) @@ -227,7 +227,7 @@ func cutFileWithEncryption(file string) ([]string, error) { if i+1 != segmentCount { return segment, errors.New("read file err") } - copy(buf[num:], []byte(utils.RandStr(segmentSize-num))) + copy(buf[num:], make([]byte, segmentSize-num, segmentSize-num)) } hash, err := utils.CalcSHA256(buf)