aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/storage/types.go
diff options
context:
space:
mode:
authorAlexey Sharov <www.pismeco@gmail.com>2018-11-14 16:21:14 +0800
committerViktor TrĂ³n <viktor.tron@gmail.com>2018-11-14 16:21:14 +0800
commiteb8fa3cc89ae3a3247c649486839b1c250554d2d (patch)
treec61b8ebebc739db0e5413cd214fdd0d3da2fe61e /swarm/storage/types.go
parentcff97119a713a6f790893aaf1c172a397a48bf33 (diff)
downloaddexon-eb8fa3cc89ae3a3247c649486839b1c250554d2d.tar
dexon-eb8fa3cc89ae3a3247c649486839b1c250554d2d.tar.gz
dexon-eb8fa3cc89ae3a3247c649486839b1c250554d2d.tar.bz2
dexon-eb8fa3cc89ae3a3247c649486839b1c250554d2d.tar.lz
dexon-eb8fa3cc89ae3a3247c649486839b1c250554d2d.tar.xz
dexon-eb8fa3cc89ae3a3247c649486839b1c250554d2d.tar.zst
dexon-eb8fa3cc89ae3a3247c649486839b1c250554d2d.zip
cmd/swarm, swarm/api/http, swarm/bmt, swarm/fuse, swarm/network/stream, swarm/storage, swarm/storage/encryption, swarm/testutil: use pseudo-random instead of crypto-random for test files content generation (#18083)
- Replace "crypto/rand" to "math/rand" for files content generation - Remove swarm/network_test.go.Shuffle and swarm/btm/btm_test.go.Shuffle - because go1.9 support dropped (see https://github.com/ethereum/go-ethereum/pull/17807 and comments to swarm/network_test.go.Shuffle)
Diffstat (limited to 'swarm/storage/types.go')
-rw-r--r--swarm/storage/types.go11
1 files changed, 0 insertions, 11 deletions
diff --git a/swarm/storage/types.go b/swarm/storage/types.go
index 092843db0..42557766e 100644
--- a/swarm/storage/types.go
+++ b/swarm/storage/types.go
@@ -25,7 +25,6 @@ import (
"fmt"
"hash"
"io"
- "io/ioutil"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto/sha3"
@@ -251,16 +250,6 @@ func GenerateRandomChunks(dataSize int64, count int) (chunks []Chunk) {
return chunks
}
-func GenerateRandomData(l int) (r io.Reader, slice []byte) {
- slice, err := ioutil.ReadAll(io.LimitReader(rand.Reader, int64(l)))
- if err != nil {
- panic("rand error")
- }
- // log.Warn("generate random data", "len", len(slice), "data", common.Bytes2Hex(slice))
- r = io.LimitReader(bytes.NewReader(slice), int64(l))
- return r, slice
-}
-
// Size, Seek, Read, ReadAt
type LazySectionReader interface {
Context() context.Context