@cryptotaxi247 / kubo / commits / bf7dd2bd2

remove randbo from godeps

License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>

Jeromy committed Feb 8, 2016 at 23:10 UTC bf7dd2bd2bec2f84d3f2eea71d0b17eee33632e8
7 files changed +6 -91
Godeps/_workspace/src/github.com/dustin/randbo/.gitignore deleted
-2
@@ -1,2 +0,0 @@
1 -
2 -*~
Godeps/_workspace/src/github.com/dustin/randbo/README.markdown deleted
-11
@@ -1,11 +0,0 @@
1 -A fast random number `io.Reader` implementation.
2 -
3 -![randbo](https://raw.github.com/dustin/randbo/master/randbo.png)
4 -
5 -> IN A WORLD where no integer sequence is certain ...
6 ->
7 -> ONE MAN must become statistically indistinguishable from noise
8 ->
9 -> THIS SUMMER, entropy has a new name: RANDBO
10 -
11 -(thanks @snej)
Godeps/_workspace/src/github.com/dustin/randbo/randbo.go deleted
-40
@@ -1,40 +0,0 @@
1 -package randbo
2 -
3 -import (
4 - "io"
5 - "math/rand"
6 - "time"
7 -)
8 -
9 -// Randbo creates a stream of non-crypto quality random bytes
10 -type randbo struct {
11 - rand.Source
12 -}
13 -
14 -// New creates a new random reader with a time source.
15 -func New() io.Reader {
16 - return NewFrom(rand.NewSource(time.Now().UnixNano()))
17 -}
18 -
19 -// NewFrom creates a new reader from your own rand.Source
20 -func NewFrom(src rand.Source) io.Reader {
21 - return &randbo{src}
22 -}
23 -
24 -// Read satisfies io.Reader
25 -func (r *randbo) Read(p []byte) (n int, err error) {
26 - todo := len(p)
27 - offset := 0
28 - for {
29 - val := int64(r.Int63())
30 - for i := 0; i < 8; i++ {
31 - p[offset] = byte(val)
32 - todo--
33 - if todo == 0 {
34 - return len(p), nil
35 - }
36 - offset++
37 - val >>= 8
38 - }
39 - }
40 -}
Godeps/_workspace/src/github.com/dustin/randbo/randbo.png
Binary files a/Godeps/_workspace/src/github.com/dustin/randbo/randbo.png and /dev/null differ
Godeps/_workspace/src/github.com/dustin/randbo/randbo_test.go deleted
-37
@@ -1,37 +0,0 @@
1 -package randbo
2 -
3 -import (
4 - "crypto/rand"
5 - "io"
6 - "io/ioutil"
7 - "testing"
8 -)
9 -
10 -func TestRandbo(t *testing.T) {
11 - buf := make([]byte, 16)
12 - n, err := New().Read(buf)
13 - if err != nil {
14 - t.Fatalf("Error reading: %v", err)
15 - }
16 - if n != len(buf) {
17 - t.Fatalf("Short read: %v", n)
18 - }
19 - t.Logf("Read %x", buf)
20 -}
21 -
22 -const toCopy = 1024 * 1024
23 -
24 -func BenchmarkRandbo(b *testing.B) {
25 - b.SetBytes(toCopy)
26 - r := New()
27 - for i := 0; i < b.N; i++ {
28 - io.CopyN(ioutil.Discard, r, toCopy)
29 - }
30 -}
31 -
32 -func BenchmarkCrypto(b *testing.B) {
33 - b.SetBytes(toCopy)
34 - for i := 0; i < b.N; i++ {
35 - io.CopyN(ioutil.Discard, rand.Reader, toCopy)
36 - }
37 -}
mfs/mfs_test.go
+1 -1
@@ -13,10 +13,10 @@ import (
13 "testing"
14 "time"
15
16 - randbo "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/dustin/randbo"
16 ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore"
17 dssync "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore/sync"
18 "github.com/ipfs/go-ipfs/path"
19 + randbo "gx/ipfs/QmYvsG72GsfLgUeSojXArjnU6L4Wmwk7wuAxtNLuyXcc1T/randbo"
20 "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
21
22 bstore "github.com/ipfs/go-ipfs/blocks/blockstore"
package.json
+5
@@ -21,6 +21,11 @@
21 "name": "goprocess",
22 "hash": "QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn",
23 "version": "0.0.0"
24 + },
25 + {
26 + "name": "randbo",
27 + "hash": "QmYvsG72GsfLgUeSojXArjnU6L4Wmwk7wuAxtNLuyXcc1T",
28 + "version": "0.0.0"
29 }
30 ],
31 "language": "go",