Crates.io | sphinx-packet |
lib.rs | sphinx-packet |
version | 0.1.1 |
source | src |
created_at | 2023-02-22 09:52:01.130597 |
updated_at | 2024-05-21 13:37:33.318225 |
description | A Sphinx packet implementation in Rust |
homepage | |
repository | https://github.com/nymtech/sphinx |
max_upload_size | |
id | 791682 |
size | 187,350 |
A Sphinx packet implementation in Rust.
cargo test
will run the unit and integration tests.
If you want to find out how you're doing in terms of code coverage, install docker and then run the code coverage shell script at ./scripts/coverage_report.sh
. Docker will download all the dependencies (get a coffee!), and output an HTML code coverage report at coverage/tarpaulin-report.html
. Open the generated file in your browser to check coverage.
Unit + integration test coverage is currently well above 90%, please ensure that any pull requests maintain good test coverage.
To run benchmarks, use:
cargo bench
Rust benchmarks run the operation multiple times to give a consistent output and report back in the number of nanoseconds (billionths of a second) per iteration. 1000000000 / result
gives you the number of operations per second.
For later reference, on Dave's i7 Dell XPS-13 (2018) laptop (our test reference machine :)) output is as follows.
test tests::bench_new ... bench: 386.348 us/iter
test tests::bench_process ... bench: 157.322 us/iter
1000000 / 386.348
= ~2588 packet creations per second1000000 / 157.322
= ~6356 packet unwrappings per second