Skip to content

Instantly share code, notes, and snippets.

View dignifiedquire's full-sized avatar

Friedel Ziegelmayer dignifiedquire

View GitHub Profile

benches with u32 digits

running 43 tests
test divide_0          ... bench:         876 ns/iter (+/- 73)
test divide_1          ... bench:      13,661 ns/iter (+/- 2,020)
test divide_2          ... bench:     697,781 ns/iter (+/- 239,589)
test fac_to_string     ... bench:       1,048 ns/iter (+/- 133)
test factorial_100     ... bench:       8,093 ns/iter (+/- 2,855)
test fib2_100          ... bench:       2,150 ns/iter (+/- 503)
ipfs daemon
Initializing daemon...
Swarm listening on /ip4/10.8.0.18/tcp/4001
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip4/192.168.0.38/tcp/4001
Swarm listening on /ip4/34.202.193.223/tcp/1027
Swarm listening on /ip6/2a02:8071:b689:2000:4ea:b2c:43a3:dc93/tcp/4001
Swarm listening on /ip6/2a02:8071:b689:2000:5d67:6d90:8956:99d8/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
const multihashing = require('multihashing-async')
const CID = require('cids')
const mh = require('multihashing')
// data - Buffer or string, the data to encode
// hashtype - string
// codec - string, 'dag-pb' or 'dag-cbor', one
// callback - called with (Error, CID) depending on the result
function elcidEncode (data, hashtype, codec, callback) {
if (typeof data === 'string') {
// torn between addr, multiaddr, multiaddress and address
// multi<> seems not needed as we only ever talk about multiaddresses so I feel that is superflous in this context
// Manage multiaddrs
// TODO: do we want ttl handling now?
class MultiaddrSet {
constructor (addrs) {}
get length () {}
DEBUG=libp2p* node_modules/mocha/bin/mocha --timeout 50000 test/index.spec.js
DHT
libp2p:swarm:dialer create: 8 peer limit, 10000 dial timeout +0ms
libp2p:swarm:transport adding TCP +6ms
libp2p:tcp:listen Listening on 9990 127.0.0.1 +6ms
libp2p:swarm:dialer create: 8 peer limit, 10000 dial timeout +3ms
libp2p:swarm:transport adding TCP +1ms
libp2p:tcp:listen Listening on 9991 127.0.0.1 +1ms
./bin/gx --verbose install
installing package: go-ipfs-0.4.6-dev
[1 / 49] fetched dep: goprocess
[2 / 49] fetched dep: go-log
[3 / 49] fetched dep: go-libp2p-crypto
[4 / 49] fetched dep: semver
[5 / 49] fetched dep: go-libp2p-peer
[6 / 49] fetched dep: bbloom
[7 / 49] fetched dep: go-libp2p-secio
[8 / 49] fetched dep: base32
RUST_BACKTRACE=1 cargo +stable test
Updating git repository `https://github.com/flier/rust-bindgen`
Compiling bindgen v0.21.2 (https://github.com/flier/rust-bindgen?branch=fix-493#e08072a1)
Compiling librtcd v0.1.0 (file:///Users/dignifiedquire/opensource/webrtc/librtcd.rs)
error[E0428]: a type named `const_iterator` has already been defined in this module
--> /Users/dignifiedquire/opensource/webrtc/librtcd.rs/target/debug/build/librtcd-c59004986512dc00/out/bindings.rs:47050:5
|
47048 | pub type const_iterator =
| _____- starting here...
47049 | | root::std::__wrap_iter<*const ::std::os::raw::c_char>;
RUST_BACKTRACE=1 RUST_LOG=bindgen cargo build
Updating registry `https://github.com/rust-lang/crates.io-index`
Compiling bindgen v0.21.2
Compiling librtcd v0.1.0 (file:///Users/dignifiedquire/opensource/webrtc/librtcd.rs)
error[E0428]: a type named `difference_type` has already been defined in this module
--> /Users/dignifiedquire/opensource/webrtc/librtcd.rs/target/debug/build/librtcd-8a0cfdcd85090276/out/bindings.rs:36704:5
|
36702 | pub type difference_type = isize;
| --------------------------------- previous definition of `difference_type` here
36703 | pub type type_ = root::difference_type;
➜ librtcdcpp (master) ✗ git add .
g% ➜ librtcdcpp (master) ✗ git stash
Saved working directory and index state WIP on master: 8a96882 Adjusted Copyright.
HEAD is now at 8a96882 Adjusted Copyright.
➜ librtcdcpp (master) ✔ mkdir build
➜ librtcdcpp (master) ✔ cd build
➜ build (master) ✔ cmake ..
-- The CXX compiler identification is AppleClang 8.0.0.8000042
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
librtcdcpp (master) ✔ cmake CMakeLists.txt
-- The CXX compiler identification is AppleClang 8.0.0.8000042
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found