diff --git a/Godeps/_workspace/src/github.com/dustin/randbo/.gitignore b/Godeps/_workspace/src/github.com/dustin/randbo/.gitignore deleted file mode 100644 index 9f8072e98..000000000 --- a/Godeps/_workspace/src/github.com/dustin/randbo/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ - -*~ diff --git a/Godeps/_workspace/src/github.com/dustin/randbo/README.markdown b/Godeps/_workspace/src/github.com/dustin/randbo/README.markdown deleted file mode 100644 index 7f2ae4f03..000000000 --- a/Godeps/_workspace/src/github.com/dustin/randbo/README.markdown +++ /dev/null @@ -1,11 +0,0 @@ -A fast random number `io.Reader` implementation. - -![randbo](https://raw.github.com/dustin/randbo/master/randbo.png) - -> IN A WORLD where no integer sequence is certain ... -> -> ONE MAN must become statistically indistinguishable from noise -> -> THIS SUMMER, entropy has a new name: RANDBO - -(thanks @snej) diff --git a/Godeps/_workspace/src/github.com/dustin/randbo/randbo.go b/Godeps/_workspace/src/github.com/dustin/randbo/randbo.go deleted file mode 100644 index 8159c53ba..000000000 --- a/Godeps/_workspace/src/github.com/dustin/randbo/randbo.go +++ /dev/null @@ -1,40 +0,0 @@ -package randbo - -import ( - "io" - "math/rand" - "time" -) - -// Randbo creates a stream of non-crypto quality random bytes -type randbo struct { - rand.Source -} - -// New creates a new random reader with a time source. -func New() io.Reader { - return NewFrom(rand.NewSource(time.Now().UnixNano())) -} - -// NewFrom creates a new reader from your own rand.Source -func NewFrom(src rand.Source) io.Reader { - return &randbo{src} -} - -// Read satisfies io.Reader -func (r *randbo) Read(p []byte) (n int, err error) { - todo := len(p) - offset := 0 - for { - val := int64(r.Int63()) - for i := 0; i < 8; i++ { - p[offset] = byte(val) - todo-- - if todo == 0 { - return len(p), nil - } - offset++ - val >>= 8 - } - } -} diff --git a/Godeps/_workspace/src/github.com/dustin/randbo/randbo.png b/Godeps/_workspace/src/github.com/dustin/randbo/randbo.png deleted file mode 100644 index c58f3dda9..000000000 Binary files a/Godeps/_workspace/src/github.com/dustin/randbo/randbo.png and /dev/null differ diff --git a/Godeps/_workspace/src/github.com/dustin/randbo/randbo_test.go b/Godeps/_workspace/src/github.com/dustin/randbo/randbo_test.go deleted file mode 100644 index 8565bb1b9..000000000 --- a/Godeps/_workspace/src/github.com/dustin/randbo/randbo_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package randbo - -import ( - "crypto/rand" - "io" - "io/ioutil" - "testing" -) - -func TestRandbo(t *testing.T) { - buf := make([]byte, 16) - n, err := New().Read(buf) - if err != nil { - t.Fatalf("Error reading: %v", err) - } - if n != len(buf) { - t.Fatalf("Short read: %v", n) - } - t.Logf("Read %x", buf) -} - -const toCopy = 1024 * 1024 - -func BenchmarkRandbo(b *testing.B) { - b.SetBytes(toCopy) - r := New() - for i := 0; i < b.N; i++ { - io.CopyN(ioutil.Discard, r, toCopy) - } -} - -func BenchmarkCrypto(b *testing.B) { - b.SetBytes(toCopy) - for i := 0; i < b.N; i++ { - io.CopyN(ioutil.Discard, rand.Reader, toCopy) - } -} diff --git a/mfs/mfs_test.go b/mfs/mfs_test.go index b8ba320ce..060f8083c 100644 --- a/mfs/mfs_test.go +++ b/mfs/mfs_test.go @@ -13,10 +13,10 @@ import ( "testing" "time" - randbo "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/dustin/randbo" ds "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore" dssync "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/ipfs/go-datastore/sync" "github.com/ipfs/go-ipfs/path" + randbo "gx/ipfs/QmYvsG72GsfLgUeSojXArjnU6L4Wmwk7wuAxtNLuyXcc1T/randbo" "gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context" bstore "github.com/ipfs/go-ipfs/blocks/blockstore" diff --git a/package.json b/package.json index 6cfb15058..f727583a0 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,11 @@ "name": "goprocess", "hash": "QmQopLATEYMNg7dVqZRNDfeE2S1yKy8zrRh5xnYiuqeZBn", "version": "0.0.0" + }, + { + "name": "randbo", + "hash": "QmYvsG72GsfLgUeSojXArjnU6L4Wmwk7wuAxtNLuyXcc1T", + "version": "0.0.0" } ], "language": "go",