MCPcopy
hub / github.com/chaozh/MIT-6.824 / randstring

Function randstring

src/shardkv/config.go:20–25  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

18import "time"
19
20func randstring(n int) string {
21 b := make([]byte, 2*n)
22 crand.Read(b)
23 s := base64.URLEncoding.EncodeToString(b)
24 return s[0:n]
25}
26
27func makeSeed() int64 {
28 max := big.NewInt(int64(1) << 62)

Callers 15

TestStaticShardsFunction · 0.70
TestJoinLeaveFunction · 0.70
TestSnapshotFunction · 0.70
TestMissChangeFunction · 0.70
TestConcurrent1Function · 0.70
TestConcurrent2Function · 0.70
TestConcurrent3Function · 0.70
TestUnreliable1Function · 0.70
TestUnreliable2Function · 0.70
TestUnreliable3Function · 0.70
TestChallenge1DeleteFunction · 0.70
makeClientMethod · 0.70

Calls 1

ReadMethod · 0.80

Tested by 11

TestStaticShardsFunction · 0.56
TestJoinLeaveFunction · 0.56
TestSnapshotFunction · 0.56
TestMissChangeFunction · 0.56
TestConcurrent1Function · 0.56
TestConcurrent2Function · 0.56
TestConcurrent3Function · 0.56
TestUnreliable1Function · 0.56
TestUnreliable2Function · 0.56
TestUnreliable3Function · 0.56
TestChallenge1DeleteFunction · 0.56