This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package rabin | |
import ( | |
"bufio" | |
"bytes" | |
"crypto/rand" | |
"fmt" | |
"io" | |
"testing" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ok github.com/jbenet/go-ipfs/bitswap 0.140s coverage: 14.6% of statements | |
? github.com/jbenet/go-ipfs/blocks [no test files] | |
ok github.com/jbenet/go-ipfs/blockservice 0.011s coverage: 61.3% of statements | |
? github.com/jbenet/go-ipfs/cmd/ipfs [no test files] | |
ok github.com/jbenet/go-ipfs/config 0.013s coverage: 32.1% of statements | |
ok github.com/jbenet/go-ipfs/core 9.705s coverage: 58.3% of statements | |
? github.com/jbenet/go-ipfs/core/commands [no test files] | |
? github.com/jbenet/go-ipfs/crypto [no test files] | |
? github.com/jbenet/go-ipfs/daemon [no test files] | |
? github.com/jbenet/go-ipfs/fuse/readonly [no test files] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Identity": { | |
"PeerID": "QmapEQ7xvrjcmqBF3i9umTA9eUXnTA5WLisnXYGg7NiEwG", | |
"PrivKey": "Should be your private key here", | |
"Address": "/ip4/127.0.0.1/tcp/4001" | |
}, | |
"Datastore": { | |
"Type": "leveldb", | |
"Path": "/home/whyrusleeping/.go-ipfs/datastore" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package crypto | |
type PrivKey interface { | |
Sign([]byte) ([]byte, error) | |
Decrypt([]byte) ([]byte, error) | |
GetPublic() PubKey | |
GenSecret() []byte | |
} | |
type PubKey interface { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dht | |
import ( | |
"time" | |
u "github.com/jbenet/go-ipfs/util" | |
peer "github.com/jbenet/go-ipfs/peer" | |
) | |
type ProviderManager struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
dht "github.com/jbenet/go-ipfs/routing/dht" | |
peer "github.com/jbenet/go-ipfs/peer" | |
ma "github.com/jbenet/go-multiaddr" | |
u "github.com/jbenet/go-ipfs/util" | |
"crypto/rand" | |
"time" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dht; | |
//run `protoc --go_out=. *.proto` to generate | |
message DHTMessage { | |
enum MessageType { | |
PUT_VALUE = 0; | |
GET_VALUE = 1; | |
PING = 2; | |
FIND_NODE = 3; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void | |
SDL_BlitCopy(SDL_BlitInfo * info) | |
{ | |
SDL_bool overlap; | |
Uint8 *src, *dst; | |
int w, h; | |
int srcskip, dstskip; | |
w = info->dst_w * info->dst_fmt->BytesPerPixel; | |
h = info->dst_h; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"os" | |
"bufio" | |
"fmt" | |
) | |
func ReadFile(path string) []string { | |
fi,err := os.Open(path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int myFunc(int x, int y) { | |
return x + y | |
} | |
int main() { | |
int x = 1; | |
int y = 2; | |
int z = myFunc(x,y); | |
} |