From 6f3eb919c76dfe0121f2484d5074f59b5d01f1e7 Mon Sep 17 00:00:00 2001 From: Sebastien Rousseau Date: Sat, 11 May 2024 17:00:18 +0100 Subject: [PATCH 1/7] v0.0.8 --- .cargo/config.toml | 2 - .github/workflows/audit.yml | 7 +- .github/workflows/check.yml | 1 + .github/workflows/coverage.yml | 61 ++ .github/workflows/document.yml | 17 +- .github/workflows/release.yml | 126 +--- .github/workflows/test.yml | 31 +- .gitignore | 1 + Cargo.lock | 1000 +++++++++++++------------------- Cargo.toml | 123 +++- README.md | 4 +- TEMPLATE.md | 4 +- benches/criterion.rs | 8 +- build.rs | 2 +- examples/hsh.rs | 50 +- src/algorithms/argon2i.rs | 20 +- src/algorithms/bcrypt.rs | 20 +- src/algorithms/mod.rs | 2 +- src/algorithms/scrypt.rs | 23 +- src/lib.rs | 27 +- src/macros.rs | 5 +- src/models/hash.rs | 66 ++- src/models/hash_algorithm.rs | 20 +- src/models/mod.rs | 2 +- tests/test_argon2i.rs | 18 +- tests/test_bcrypt.rs | 20 +- tests/test_hash.rs | 2 +- tests/test_hash_algorithm.rs | 14 +- tests/test_loggers.rs | 159 +++-- tests/test_macros.rs | 5 +- tests/test_scrypt.rs | 40 +- xtask/Cargo.toml | 15 - xtask/src/main.rs | 5 - 33 files changed, 925 insertions(+), 975 deletions(-) delete mode 100644 .cargo/config.toml create mode 100644 .github/workflows/coverage.yml delete mode 100644 xtask/Cargo.toml delete mode 100644 xtask/src/main.rs diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 3f72aba..0000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[alias] -xtask = "run --package xtask --bin xtask --" \ No newline at end of file diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 3369d2b..5d85567 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -3,6 +3,7 @@ name: 🧪 Audit on: push: branches: + - main - feat/hsh pull_request: branches: @@ -18,6 +19,10 @@ jobs: - uses: hecrj/setup-rust-action@v2 - name: Install cargo-audit run: cargo install cargo-audit + - uses: actions/checkout@v4 - - name: Audit dependencies + - name: Resolve dependencies + run: cargo update + + - name: Audit vulnerabilities run: cargo audit \ No newline at end of file diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index ca7c9d9..ecb1d23 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -3,6 +3,7 @@ name: 🧪 Check on: push: branches: + - main - feat/hsh pull_request: branches: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..ea5a28f --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,61 @@ +name: 📶 Coverage + +on: + push: + branches: + - main + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + coverage: + name: Code Coverage + runs-on: ubuntu-latest + env: + CARGO_INCREMENTAL: "0" + RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" + RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests" + + steps: + # Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4 + + # Setup Rust nightly + - name: Install Rust + uses: actions-rs/toolchain@v1 + id: toolchain + with: + toolchain: nightly + override: true + + # Configure cache for Cargo + - name: Cache Cargo registry, index + uses: actions/cache@v4 + id: cache-cargo + with: + path: | + ~/.cargo/registry + ~/.cargo/bin + ~/.cargo/git + key: linux-${{ steps.toolchain.outputs.rustc_hash }}-rust-cov-${{ hashFiles('**/Cargo.lock') }} + + # Run tests with all features + - name: Test (cargo test) + uses: actions-rs/cargo@v1 + with: + command: test + args: "--workspace" + + # Install grcov + - uses: actions-rs/grcov@v0.1 + id: coverage + + # Upload to Codecov.io + - name: Upload to Codecov.io + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ${{ steps.coverage.outputs.report }} \ No newline at end of file diff --git a/.github/workflows/document.yml b/.github/workflows/document.yml index b9eac92..e3eeae9 100644 --- a/.github/workflows/document.yml +++ b/.github/workflows/document.yml @@ -3,10 +3,10 @@ name: 🧪 Document on: push: branches: - - feat/hsh + - main pull_request: branches: - - feat/hsh + - main release: types: [created] @@ -45,16 +45,15 @@ jobs: retention-days: 1 - name: Write CNAME file - run: echo 'doc.hshlib.one' > ./target/doc/CNAME + run: echo 'doc.hshlib.com' > ./target/doc/CNAME - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v4 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./target/doc - publish_branch: gh-pages cname: true - clean: true commit_message: Deploy documentation at ${{ github.sha }} - commit_user_name: github-actions - commit_user_email: actions@users.noreply.github.com \ No newline at end of file + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_branch: gh-pages + publish_dir: ./target/doc + user_email: actions@users.noreply.github.com + user_name: github-actions \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b7939c3..7a91f7c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,15 @@ name: 🧪 Release -on: [push, pull_request] +on: + push: + branches: + - main + - feat/hsh + pull_request: + branches: + - feat/hsh + release: + types: [created] concurrency: group: ${{ github.ref }} @@ -21,114 +30,25 @@ jobs: BUILD_ID: ${{ github.run_id }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_API_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OS: ${{ matrix.os }} - TARGET: ${{ matrix.target }} + OS: ${{ matrix.platform.os }} + TARGET: ${{ matrix.platform.target }} strategy: fail-fast: false matrix: - target: - # List of targets: - # https://doc.rust-lang.org/nightly/rustc/platform-support.html - - # Tier 1 platforms 🏆 - - aarch64-unknown-linux-gnu # 64-bit Linux systems on ARM architecture - - i686-pc-windows-gnu # 32-bit Windows (i686-pc-windows-gnu) - - i686-pc-windows-msvc # 32-bit Windows (i686-pc-windows-msvc) - - i686-unknown-linux-gnu # 32-bit Linux (kernel 3.2+, glibc 2.17+) - - x86_64-apple-darwin # 64-bit macOS (10.7 Lion or later) - - x86_64-pc-windows-gnu # 64-bit Windows (x86_64-pc-windows-gnu) - - x86_64-pc-windows-msvc # 64-bit Windows (x86_64-pc-windows-msvc) - - x86_64-unknown-linux-gnu # 64-bit Linux (kernel 2.6.32+, glibc 2.11+) - - # Tier 2 platforms 🥈 - - aarch64-apple-darwin # 64-bit macOS on Apple Silicon - - aarch64-pc-windows-msvc # 64-bit Windows (aarch64-pc-windows-msvc) - - aarch64-unknown-linux-musl # 64-bit Linux systems on ARM architecture - - arm-unknown-linux-gnueabi # ARMv6 Linux (kernel 3.2, glibc 2.17) - - arm-unknown-linux-gnueabihf # ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17) - - armv7-unknown-linux-gnueabihf # ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17) - - powerpc-unknown-linux-gnu # PowerPC Linux (kernel 3.2, glibc 2.17) - - powerpc64-unknown-linux-gnu # PowerPC64 Linux (kernel 3.2, glibc 2.17) - - powerpc64le-unknown-linux-gnu # PowerPC64le Linux (kernel 3.2, glibc 2.17) - - riscv64gc-unknown-linux-gnu # RISC-V Linux (kernel 3.2, glibc 2.17) - - s390x-unknown-linux-gnu # s390x Linux (kernel 3.2, glibc 2.17) - - x86_64-unknown-freebsd # 64-bit FreeBSD on x86-64 - - x86_64-unknown-linux-musl # 64-bit Linux (kernel 2.6.32+, musl libc) - - x86_64-unknown-netbsd # 64-bit NetBSD on x86-64 - - include: - # Tier 1 platforms 🏆 - - target: aarch64-unknown-linux-gnu - os: ubuntu-latest - cross: true - - target: i686-pc-windows-gnu - os: ubuntu-latest - cross: true - - target: i686-pc-windows-msvc + platform: + - target: x86_64-pc-windows-msvc + os: windows-latest + - target: aarch64-pc-windows-msvc os: windows-latest - cross: true - - target: i686-unknown-linux-gnu - os: ubuntu-latest - cross: true - target: x86_64-apple-darwin os: macos-latest - cross: true - - target: x86_64-pc-windows-gnu - os: ubuntu-latest - cross: true - - target: x86_64-pc-windows-msvc - os: windows-latest - cross: true - - target: x86_64-unknown-linux-gnu - os: ubuntu-latest - cross: true - - # Tier 2 platforms 🥈 - target: aarch64-apple-darwin os: macos-latest - cross: true - - target: aarch64-pc-windows-msvc - os: windows-latest - cross: true - - target: aarch64-unknown-linux-musl - os: ubuntu-latest - cross: true - - target: arm-unknown-linux-gnueabi - os: ubuntu-latest - cross: true - - target: arm-unknown-linux-gnueabihf - os: ubuntu-latest - cross: true - - target: armv7-unknown-linux-gnueabihf - os: ubuntu-latest - cross: true - - target: powerpc-unknown-linux-gnu - os: ubuntu-latest - cross: true - - target: powerpc64-unknown-linux-gnu - os: ubuntu-latest - cross: true - - target: powerpc64le-unknown-linux-gnu - os: ubuntu-latest - cross: true - - target: riscv64gc-unknown-linux-gnu - os: ubuntu-latest - cross: true - - target: s390x-unknown-linux-gnu - os: ubuntu-latest - cross: true - - target: x86_64-unknown-freebsd - os: ubuntu-latest - cross: true - - target: x86_64-unknown-linux-musl - os: ubuntu-latest - cross: true - - target: x86_64-unknown-netbsd + - target: x86_64-unknown-linux-gnu os: ubuntu-latest - cross: true - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.platform.os }} steps: # Check out the repository code. @@ -158,21 +78,11 @@ jobs: id: install-target run: rustup target add ${{ env.TARGET }} - - name: Install Cross and clean artifacts - run: | - # Install cross - cargo install cross - - # Clean the build artifacts - cargo clean --verbose - shell: bash - # Build the targets - name: Build targets id: build-targets uses: actions-rs/cargo@v1 with: - use-cross: true command: build args: --verbose --workspace --release --target ${{ env.TARGET }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9b696ad..fe897a5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,33 +37,4 @@ jobs: # Run tests with all features - name: Run tests with all features id: run-tests-all-features - run: cargo test --verbose --workspace --all-features - - # Install grcov - - name: Install grcov - # Only run this job on the main branch when a commit is pushed. - if: github.ref == 'refs/heads/main' && github.event_name == 'push' - id: install-grcov - run: | - mkdir -p "${HOME}/.local/bin" - curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.18/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - -C "${HOME}/.local/bin" - echo "$HOME/.local/bin" >> $GITHUB_PATH - - # Use grcov to generate a coverage report - - name: Generate coverage report - # Only run this job on the main branch when a commit is pushed. - if: github.ref == 'refs/heads/main' && github.event_name == 'push' - id: generate-code-coverage - uses: actions-rs/cargo@v1.0.1 - with: - command: xtask - args: coverage - - # Upload the coverage report to codecov - - name: Upload coverage report to codecov - # Only run this job on the main branch when a commit is pushed. - if: github.ref == 'refs/heads/main' && github.event_name == 'push' - id: upload-report-codecov - uses: codecov/codecov-action@v4 - with: - files: coverage/*.lcov \ No newline at end of file + run: cargo test --verbose --workspace --all-features \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7b5a0e0..8326096 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ build Icon? src/.DS_Store tarpaulin-report.html +Cargo.lock \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index d0393b1..cf6d7c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,11 +2,26 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aho-corasick" -version = "1.0.5" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -19,15 +34,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstyle" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" - -[[package]] -name = "anyhow" -version = "1.0.83" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "argon2rs" @@ -50,9 +59,9 @@ dependencies = [ [[package]] name = "assert_cmd" -version = "2.0.13" +version = "2.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00ad3f3a942eee60335ab4342358c161ee296829e0d16ff42fc1d6cb07815467" +checksum = "ed72493ac66d5804837f480ab3766c72bdfab91a65e565fc54fa9e42db0073a8" dependencies = [ "anstyle", "bstr", @@ -64,27 +73,31 @@ dependencies = [ ] [[package]] -name = "atty" -version = "0.2.14" +name = "autocfg" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] -name = "autocfg" -version = "1.1.0" +name = "backtrace" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -107,9 +120,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "1.3.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "blake2-rfc" @@ -142,27 +155,32 @@ dependencies = [ [[package]] name = "bstr" -version = "1.4.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d4260bcc2e8fc9df1eac4919a720effeb63a3f0952f5bf4944adfa18897f09" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", - "once_cell", - "regex-automata 0.1.10", + "regex-automata", "serde", ] [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cast" @@ -172,9 +190,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" [[package]] name = "cfg-if" @@ -184,9 +202,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "ciborium" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ "ciborium-io", "ciborium-ll", @@ -195,15 +213,15 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" [[package]] name = "ciborium-ll" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", "half", @@ -221,65 +239,28 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" -dependencies = [ - "atty", - "bitflags", - "clap_lex 0.2.4", - "indexmap", - "strsim", - "termcolor", - "textwrap", -] - -[[package]] -name = "clap" -version = "4.4.7" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.4.7" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstyle", - "clap_lex 0.6.0", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", + "clap_lex", ] [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" - -[[package]] -name = "console" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d79fbe8970a77e3e34151cc13d3b3e248aa0faaecb9f6091fa07ebefe5ad60" -dependencies = [ - "encode_unicode", - "lazy_static", - "libc", - "unicode-width", - "windows-sys 0.42.0", -] +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "constant_time_eq" @@ -289,9 +270,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -305,7 +286,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.4.7", + "clap", "criterion-plot", "is-terminal", "itertools", @@ -332,48 +313,36 @@ dependencies = [ "itertools", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.13" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.14" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-common" @@ -385,93 +354,15 @@ dependencies = [ "typenum", ] -[[package]] -name = "darling" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 1.0.107", -] - -[[package]] -name = "darling_macro" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" -dependencies = [ - "darling_core", - "quote", - "syn 1.0.107", -] - [[package]] name = "deranged" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] -[[package]] -name = "derive_builder" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 1.0.107", -] - -[[package]] -name = "derive_builder_macro" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" -dependencies = [ - "derive_builder_core", - "syn 1.0.107", -] - -[[package]] -name = "dialoguer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" -dependencies = [ - "console", - "shell-words", - "tempfile", - "zeroize", -] - [[package]] name = "difflib" version = "0.4.0" @@ -480,9 +371,9 @@ checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -497,9 +388,9 @@ checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "dtt" -version = "0.0.6" +version = "0.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21191da49ce48aa9200e9ac040032d680b3b71a158fbecaa1a99282821c3c251" +checksum = "d6b2dd9ee2d76888dc4c17d6da74629fa11b3cb1e8094fdc159b7f8ff259fc88" dependencies = [ "regex", "serde", @@ -507,70 +398,21 @@ dependencies = [ ] [[package]] -name = "duct" -version = "0.13.6" +name = "dtt" +version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ae3fc31835f74c2a7ceda3aeede378b0ae2e74c8f1c36559fcc9ae2a4e7d3e" +checksum = "21191da49ce48aa9200e9ac040032d680b3b71a158fbecaa1a99282821c3c251" dependencies = [ - "libc", - "once_cell", - "os_pipe", - "shared_child", + "regex", + "serde", + "time", ] [[package]] name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "encode_unicode" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" - -[[package]] -name = "errno" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "fs_extra" -version = "1.3.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "generic-array" @@ -584,9 +426,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -594,46 +436,26 @@ dependencies = [ ] [[package]] -name = "glob" -version = "0.3.1" +name = "gimli" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.2.6" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ - "libc", + "cfg-if", + "crunchy", ] [[package]] name = "hermit-abi" -version = "0.3.1" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hmac" @@ -644,37 +466,32 @@ dependencies = [ "digest", ] +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + [[package]] name = "hsh" -version = "0.0.7" +version = "0.0.8" dependencies = [ "argon2rs", "assert_cmd", "base64", "bcrypt", "criterion", - "dtt", + "dtt 0.0.6", "log", "scrypt", "serde", "serde_json", - "vrd", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" -dependencies = [ - "autocfg", - "hashbrown", + "vrd 0.0.7", ] [[package]] @@ -686,36 +503,15 @@ dependencies = [ "generic-array", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" -dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "is-terminal" -version = "0.4.7" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix", - "windows-sys 0.48.0", + "hermit-abi", + "libc", + "windows-sys 0.52.0", ] [[package]] @@ -729,56 +525,71 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.5" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "libc" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] -name = "libc" -version = "0.2.139" +name = "lock_api" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] [[package]] -name = "linux-raw-sys" -version = "0.3.6" +name = "log" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64f40e5e03e0d54f03845c8197d0291253cdbedfb1cb46b13c2c117554a9f4c" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] -name = "log" -version = "0.4.20" +name = "match_cfg" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] -name = "memoffset" -version = "0.7.1" +name = "miniz_oxide" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ - "autocfg", + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", ] [[package]] @@ -795,28 +606,37 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi", "libc", ] +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" -version = "1.17.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oorandom" @@ -825,20 +645,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] -name = "os_pipe" -version = "1.1.4" +name = "parking_lot" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ - "libc", - "windows-sys 0.48.0", + "lock_api", + "parking_lot_core", ] [[package]] -name = "os_str_bytes" -version = "6.4.1" +name = "parking_lot_core" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.5", +] [[package]] name = "password-hash" @@ -853,19 +680,25 @@ dependencies = [ [[package]] name = "pbkdf2" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ca0b5a68607598bf3bad68f32227a8164f6254833f84eafaac409cd6746c31" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest", "hmac", ] +[[package]] +name = "pin-project-lite" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + [[package]] name = "plotters" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" +checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" dependencies = [ "num-traits", "plotters-backend", @@ -876,15 +709,15 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" +checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" [[package]] name = "plotters-svg" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" +checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" dependencies = [ "plotters-backend", ] @@ -903,13 +736,12 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "predicates" -version = "3.0.3" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09963355b9f467184c04017ced4a2ba2d75cbcb4e7462690d388233253d4b1a9" +checksum = "68b87bfd4605926cdfefc1c3b5f8fe560e3feca9d5552cf68c466d3d8236c7e8" dependencies = [ "anstyle", "difflib", - "itertools", "predicates-core", ] @@ -931,18 +763,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -979,9 +811,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.6.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -989,21 +821,19 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.10.2" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ "bitflags", ] @@ -1016,16 +846,10 @@ checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", + "regex-automata", "regex-syntax", ] -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" - [[package]] name = "regex-automata" version = "0.4.6" @@ -1039,29 +863,34 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] -name = "rustix" -version = "0.37.3" +name = "rlg" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b24138615de35e32031d041a09032ef3487a616d901ca4db224e7d557efae2" +checksum = "9e02c717e23f67b23032a4acb01cf63534d6259938d592e6d2451c02f09fc368" dependencies = [ - "bitflags", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys", - "windows-sys 0.45.0", + "dtt 0.0.5", + "hostname", + "serde_json", + "tokio", + "vrd 0.0.5", ] +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "salsa20" @@ -1089,9 +918,9 @@ checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scrypt" @@ -1114,6 +943,15 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-big-array" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11fc7cc2c76d73e0f27ee52abbd64eec84d46f370c88371120433196934e4b7f" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" version = "1.0.201" @@ -1122,14 +960,14 @@ checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn", ] [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -1138,9 +976,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -1148,89 +986,53 @@ dependencies = [ ] [[package]] -name = "shared_child" -version = "1.0.0" +name = "signal-hook-registry" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", - "winapi", ] [[package]] -name = "shell-words" -version = "1.1.0" +name = "smallvec" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] -name = "strsim" -version = "0.10.0" +name = "socket2" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "1.0.107" +version = "2.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "9f660c3bfcefb88c538776b6685a0c472e3128b51e74d48793dc2a488196e8eb" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys 0.45.0", -] - -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - [[package]] name = "termtree" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "time" version = "0.3.36" @@ -1260,23 +1062,56 @@ dependencies = [ "serde_json", ] +[[package]] +name = "tokio" +version = "1.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "unicode-width" -version = "0.1.10" +name = "uuid" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +dependencies = [ + "getrandom", +] [[package]] name = "version_check" @@ -1294,6 +1129,23 @@ dependencies = [ "serde", ] +[[package]] +name = "vrd" +version = "0.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08fd4c00822f48600521b6dfa7ed8103e9f38c720e198ff4db0400c925414c80" +dependencies = [ + "bitflags", + "dtt 0.0.5", + "rand", + "rlg", + "serde", + "serde-big-array", + "serde_json", + "tokio", + "uuid", +] + [[package]] name = "wait-timeout" version = "0.2.0" @@ -1305,12 +1157,11 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.3.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", - "winapi", "winapi-util", ] @@ -1322,9 +1173,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1332,24 +1183,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.107", + "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1357,28 +1208,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.61" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -1402,11 +1253,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -1417,176 +1268,145 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.42.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.48.5", ] [[package]] name = "windows-sys" -version = "0.45.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.52.5", ] [[package]] name = "windows-targets" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" - -[[package]] -name = "xtask" -version = "0.1.0" -dependencies = [ - "anyhow", - "xtaskops", -] - -[[package]] -name = "xtaskops" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464ca5c2bac1d1fcdbef9da6c09c6a14f2c7ac6c8845f574ab12065a2b72bb8b" -dependencies = [ - "anyhow", - "clap 3.2.23", - "derive_builder", - "dialoguer", - "duct", - "fs_extra", - "glob", -] +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/Cargo.toml b/Cargo.toml index b3edf3e..de18cf0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [package] -authors = ["Hash (HSH) Contributors"] +# Metadata about the package. +authors = ["The Hash (HSH) library contributors "] build = "build.rs" categories = [ "algorithms", @@ -14,14 +15,13 @@ description = """ """ documentation = "https://docs.rs/hsh" edition = "2021" -exclude = ["/.git/*", "/.github/*", "/.gitignore", "/.vscode/*"] -homepage = "https://hshlib.one/" -keywords = ["argon2", "argon2i", "hash", "password", "security"] -license = "MIT OR Apache-2.0" -name = "hsh" -repository = "https://github.com/sebastienrousseau/hsh/" -rust-version = "1.71.1" -version = "0.0.7" +exclude = [ + "/.git/*", + "/.github/*", + "/.gitignore", + "/.vscode/*" +] +homepage = "https://hshlib.com/" include = [ "/CONTRIBUTING.md", "/LICENSE-APACHE", @@ -33,13 +33,17 @@ include = [ "/README.md", "/src/**", "/tests/**", - "/xtask/**", ] - -[workspace] -members = ["xtask"] +keywords = ["argon2", "argon2i", "hash", "password", "security"] +license = "MIT OR Apache-2.0" +name = "hsh" +readme = "README.md" +repository = "https://github.com/sebastienrousseau/hsh/" +rust-version = "1.60" +version = "0.0.8" [[bench]] +# Benchmarking configuration. name = "benchmark" harness = false path = "benches/criterion.rs" @@ -48,35 +52,94 @@ path = "benches/criterion.rs" debug = true [[example]] +# Example configuration. name = "hsh" path = "examples/hsh.rs" [dependencies] +# Dependencies of the package. argon2rs = "0.2.5" -base64 = "0.22.0" +base64 = "0.22.1" bcrypt = "0.15.1" dtt = "0.0.6" -log = {version="0.4.20", features = ["std"] } -# openssl = { version = "0.10.59", features = ["vendored"] } +log = {version="0.4.21", features = ["std"] } scrypt = "0.11.0" serde = { version = "1.0.201", features = ["derive"] } -serde_json = "1.0.116" -vrd = "0.0.5" +serde_json = "1.0.117" +vrd = "0.0.7" [dev-dependencies] -assert_cmd = "2.0.13" +# Dependencies for testing and development. +assert_cmd = "2.0.14" criterion = "0.5.1" [lib] +# Metadata about the library. crate-type = ["lib"] name = "hsh" path = "src/lib.rs" [features] +# No default features default = [] [package.metadata.docs.rs] -all-features = true +targets = ["x86_64-unknown-linux-gnu"] +rustdoc-args = ["--generate-link-to-definition"] + +# Linting config +[lints.rust] + +## Warn +# box_pointers = "warn" +missing_copy_implementations = "warn" +missing_docs = "warn" +unstable_features = "warn" +# unused_crate_dependencies = "warn" +unused_extern_crates = "warn" +unused_results = "warn" + +## Allow +bare_trait_objects = "allow" +elided_lifetimes_in_paths = "allow" +non_camel_case_types = "allow" +non_upper_case_globals = "allow" +trivial_bounds = "allow" +unsafe_code = "allow" + +## Forbid +missing_debug_implementations = "forbid" +non_ascii_idents = "forbid" +unreachable_pub = "forbid" + +## Deny +dead_code = "deny" +deprecated_in_future = "deny" +ellipsis_inclusive_range_patterns = "deny" +explicit_outlives_requirements = "deny" +future_incompatible = { level = "deny", priority = -1 } +keyword_idents = "deny" +macro_use_extern_crate = "deny" +meta_variable_misuse = "deny" +missing_fragment_specifier = "deny" +noop_method_call = "deny" +pointer_structural_match = "deny" +rust_2018_idioms = { level = "deny", priority = -1 } +rust_2021_compatibility = { level = "deny", priority = -1 } +single_use_lifetimes = "deny" +trivial_casts = "deny" +trivial_numeric_casts = "deny" +unused = { level = "deny", priority = -1 } +unused_features = "deny" +unused_import_braces = "deny" +unused_labels = "deny" +unused_lifetimes = "deny" +unused_macro_rules = "deny" +unused_qualifications = "deny" +variant_size_differences = "deny" + +[package.metadata.clippy] +warn-lints = ["clippy::all", "clippy::pedantic", "clippy::cargo", "clippy::nursery"] [profile.dev] codegen-units = 256 @@ -91,16 +154,16 @@ rpath = false strip = false [profile.release] -codegen-units = 1 # Compile crates one after another so the compiler can optimize better -debug = false # Disable debug information -debug-assertions = false # Disable debug assertions -incremental = false # Disable incremental compilation -lto = true # Enables link to optimizations -opt-level = "s" # Optimize for binary size -overflow-checks = false # Disable overflow checks -panic = "abort" # Strip expensive panic clean-up logic -rpath = false # Disable rpath -strip = "symbols" # Automatically strip symbols from the binary. +codegen-units = 1 +debug = false +debug-assertions = false +incremental = false +lto = true +opt-level = "s" +overflow-checks = false +panic = "abort" +rpath = false +strip = "symbols" [profile.test] codegen-units = 256 diff --git a/README.md b/README.md index 801b900..c14c6a6 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ file: ```toml [dependencies] -hsh = "0.0.7" +hsh = "0.0.8" ``` Add the following to your `main.rs` file: @@ -239,6 +239,6 @@ lot of useful suggestions on how to improve this project. [crates-badge]: https://img.shields.io/crates/v/hsh.svg?style=for-the-badge 'Crates.io' [divider]: https://kura.pro/common/images/elements/divider.svg "divider" [docs-badge]: https://img.shields.io/docsrs/hsh.svg?style=for-the-badge 'Docs.rs' -[libs-badge]: https://img.shields.io/badge/lib.rs-v0.0.7-orange.svg?style=for-the-badge 'Lib.rs' +[libs-badge]: https://img.shields.io/badge/lib.rs-v0.0.8-orange.svg?style=for-the-badge 'Lib.rs' [license-badge]: https://img.shields.io/crates/l/hsh.svg?style=for-the-badge 'License' [made-with-rust]: https://img.shields.io/badge/rust-f04041?style=for-the-badge&labelColor=c0282d&logo=rust 'Made With Rust' diff --git a/TEMPLATE.md b/TEMPLATE.md index f0ace82..4c22a59 100644 --- a/TEMPLATE.md +++ b/TEMPLATE.md @@ -4,7 +4,7 @@ alt="Hash (HSH) logo" width="261" align="right" /> -# Hash (HSH) v0.0.7 +# Hash (HSH) v0.0.8 Quantum-Resistant Cryptographic Hash Library for Password Hashing and Verification @@ -82,7 +82,7 @@ Hash (HSH) is a lightweight library that can easily integrate into any Rust proj [crates-badge]: https://img.shields.io/crates/v/hsh.svg?style=for-the-badge 'Crates.io' [divider]: https://kura.pro/common/images/elements/divider.svg "divider" [docs-badge]: https://img.shields.io/docsrs/hsh.svg?style=for-the-badge 'Docs.rs' -[libs-badge]: https://img.shields.io/badge/lib.rs-v0.0.7-orange.svg?style=for-the-badge 'Lib.rs' +[libs-badge]: https://img.shields.io/badge/lib.rs-v0.0.8-orange.svg?style=for-the-badge 'Lib.rs' [license-badge]: https://img.shields.io/crates/l/hsh.svg?style=for-the-badge 'License' [made-with-rust]: https://img.shields.io/badge/rust-f04041?style=for-the-badge&labelColor=c0282d&logo=rust 'Made With Rust' diff --git a/benches/criterion.rs b/benches/criterion.rs index 5606caa..df0f47b 100644 --- a/benches/criterion.rs +++ b/benches/criterion.rs @@ -4,16 +4,13 @@ //! Benchmarking the Hash (HSH) library using Criterion.rs #![allow(missing_docs)] -extern crate argon2rs; -extern crate criterion; use criterion::{ black_box, criterion_group, criterion_main, Criterion, }; - -extern crate hsh; use hsh::models::hash::Hash; +#[allow(unused_results)] fn generate_hash_benchmark(c: &mut Criterion) { c.bench_function("generate_hash", |b| { b.iter(|| { @@ -26,6 +23,7 @@ fn generate_hash_benchmark(c: &mut Criterion) { }); } +#[allow(unused_results)] fn new_hash_benchmark(c: &mut Criterion) { c.bench_function("new_hash", |b| { b.iter(|| { @@ -38,6 +36,7 @@ fn new_hash_benchmark(c: &mut Criterion) { }); } +#[allow(unused_results)] fn set_password_benchmark(c: &mut Criterion) { let mut hash = Hash::new("password", "salt12345", "argon2i").unwrap(); // Unwrap the Result @@ -55,6 +54,7 @@ fn set_password_benchmark(c: &mut Criterion) { }); } +#[allow(unused_results)] fn verify_benchmark(c: &mut Criterion) { let hash = Hash::new("password", "salt12345", "argon2i").unwrap(); // Unwrap the Result diff --git a/build.rs b/build.rs index 1b653ae..a01e740 100644 --- a/build.rs +++ b/build.rs @@ -7,4 +7,4 @@ fn main() { // Avoid unnecessary re-building. println!("cargo:rerun-if-changed=build.rs"); -} \ No newline at end of file +} diff --git a/examples/hsh.rs b/examples/hsh.rs index 5790d50..bc67a0e 100644 --- a/examples/hsh.rs +++ b/examples/hsh.rs @@ -3,8 +3,11 @@ //! Using the Hash (HSH) library +use hsh::{ + models::{hash::Hash, hash_algorithm::HashAlgorithm}, + new_hash, +}; use std::str::FromStr; -use hsh::{models::{hash::Hash, hash_algorithm::HashAlgorithm}, new_hash}; /// This function demonstrates how to create and verify password hashes using Argon2i, Bcrypt, and Scrypt algorithms. /// @@ -37,9 +40,11 @@ use hsh::{models::{hash::Hash, hash_algorithm::HashAlgorithm}, new_hash}; /// Note: This is a simplified example, and in a real-world application, you should handle errors and edge cases more carefully. fn create_and_verify_hash() { // Create new hashes for Argon2i, Bcrypt, and Scrypt - let hash_argon2i = Hash::new_argon2i("password", "salt1234".into()).unwrap(); + let hash_argon2i = + Hash::new_argon2i("password", "salt1234".into()).unwrap(); let hash_bcrypt = Hash::new_bcrypt("password", 16).unwrap(); - let hash_scrypt = Hash::new_scrypt("password", "salt1234".into()).unwrap(); + let hash_scrypt = + Hash::new_scrypt("password", "salt1234".into()).unwrap(); // Verify these hashes verify_password(&hash_argon2i, "password", "Argon2i"); @@ -48,13 +53,19 @@ fn create_and_verify_hash() { // Update the hashes let mut new_hash_argon2i = hash_argon2i.clone(); - new_hash_argon2i.set_password("new_password", "salt1234", "argon2i").unwrap(); + new_hash_argon2i + .set_password("new_password", "salt1234", "argon2i") + .unwrap(); let mut new_hash_bcrypt = hash_bcrypt.clone(); - new_hash_bcrypt.set_password("new_password", "salt1234", "bcrypt").unwrap(); + new_hash_bcrypt + .set_password("new_password", "salt1234", "bcrypt") + .unwrap(); let mut new_hash_scrypt = hash_scrypt.clone(); - new_hash_scrypt.set_password("new_password", "salt1234", "scrypt").unwrap(); + new_hash_scrypt + .set_password("new_password", "salt1234", "scrypt") + .unwrap(); // Verify the updated hashes verify_password(&new_hash_argon2i, "new_password", "Argon2i"); @@ -65,18 +76,33 @@ fn create_and_verify_hash() { // Function to verify the password fn verify_password(hash: &Hash, password: &str, algorithm: &str) { // Print header - println!("\n===[ Verifying Password with {} Algorithm ]===\n", algorithm); + println!( + "\n===[ Verifying Password with {} Algorithm ]===\n", + algorithm + ); let is_valid = hash.verify(password); match is_valid { Ok(valid) => { println!("Algorithm: {}", algorithm); - println!("Provided password for verification: {}", password); - println!("Salt used for verification: {}", String::from_utf8_lossy(hash.salt())); - println!("🦀 Password verification result for {}: ✅ {:?}", algorithm, valid); - }, + println!( + "Provided password for verification: {}", + password + ); + println!( + "Salt used for verification: {}", + String::from_utf8_lossy(hash.salt()) + ); + println!( + "🦀 Password verification result for {}: ✅ {:?}", + algorithm, valid + ); + } Err(e) => { - eprintln!("🦀 Error during password verification for {}: ❌ {}", algorithm, e); + eprintln!( + "🦀 Error during password verification for {}: ❌ {}", + algorithm, e + ); } } diff --git a/src/algorithms/argon2i.rs b/src/algorithms/argon2i.rs index 1cafc3e..96d4569 100644 --- a/src/algorithms/argon2i.rs +++ b/src/algorithms/argon2i.rs @@ -3,7 +3,7 @@ use crate::models::hash_algorithm::HashingAlgorithm; use argon2rs::argon2i_simple; -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; /// Implementation of the Argon2i hashing algorithm. /// @@ -13,7 +13,18 @@ use serde::{Serialize, Deserialize}; /// /// This struct implements the `HashingAlgorithm` trait, providing a concrete implementation /// for hashing passwords using the Argon2i algorithm. -#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize, Deserialize)] +#[derive( + Clone, + Copy, + Debug, + Eq, + Hash, + Ord, + PartialEq, + PartialOrd, + Serialize, + Deserialize, +)] pub struct Argon2i; impl HashingAlgorithm for Argon2i { @@ -31,7 +42,10 @@ impl HashingAlgorithm for Argon2i { /// /// Returns a `Result` with `Ok`, containing the hashed password as a vector of bytes. /// Currently, this function does not handle hashing errors and will always return `Ok`. - fn hash_password(password: &str, salt: &str) -> Result, String> { + fn hash_password( + password: &str, + salt: &str, + ) -> Result, String> { Ok(argon2i_simple(password, salt).into_iter().collect()) } } diff --git a/src/algorithms/bcrypt.rs b/src/algorithms/bcrypt.rs index fc036fd..7ef7b0d 100644 --- a/src/algorithms/bcrypt.rs +++ b/src/algorithms/bcrypt.rs @@ -3,7 +3,7 @@ use crate::models::hash_algorithm::HashingAlgorithm; use bcrypt::{hash, DEFAULT_COST}; -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; /// Implementation of the Bcrypt hashing algorithm. /// @@ -29,7 +29,18 @@ use serde::{Serialize, Deserialize}; /// /// let hashed_password = Bcrypt::hash_password(password, salt).unwrap(); /// ``` -#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize, Deserialize)] +#[derive( + Clone, + Copy, + Debug, + Eq, + Hash, + Ord, + PartialEq, + PartialOrd, + Serialize, + Deserialize, +)] pub struct Bcrypt; impl HashingAlgorithm for Bcrypt { @@ -47,7 +58,10 @@ impl HashingAlgorithm for Bcrypt { /// /// Returns a `Result` containing the hashed password as a vector of bytes. /// If hashing fails for some reason, returns a `String` detailing the error. - fn hash_password(password: &str, _salt: &str) -> Result, String> { + fn hash_password( + password: &str, + _salt: &str, + ) -> Result, String> { hash(password, DEFAULT_COST) .map_err(|e| e.to_string()) .map(|hash_parts| hash_parts.into_bytes()) diff --git a/src/algorithms/mod.rs b/src/algorithms/mod.rs index 425f832..3aa2a53 100644 --- a/src/algorithms/mod.rs +++ b/src/algorithms/mod.rs @@ -8,4 +8,4 @@ pub mod argon2i; pub mod bcrypt; /// The `scrypt` module contains the Scrypt password hashing algorithm. -pub mod scrypt; \ No newline at end of file +pub mod scrypt; diff --git a/src/algorithms/scrypt.rs b/src/algorithms/scrypt.rs index ed05837..6a00c25 100644 --- a/src/algorithms/scrypt.rs +++ b/src/algorithms/scrypt.rs @@ -4,7 +4,7 @@ use crate::models::hash_algorithm::HashingAlgorithm; use scrypt::scrypt; use scrypt::Params; -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; /// Implementation of the Scrypt hashing algorithm. /// @@ -14,7 +14,18 @@ use serde::{Serialize, Deserialize}; /// /// This struct implements the `HashingAlgorithm` trait, providing a concrete implementation /// for hashing passwords using the Scrypt algorithm. -#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize, Deserialize)] +#[derive( + Clone, + Copy, + Debug, + Eq, + Hash, + Ord, + PartialEq, + PartialOrd, + Serialize, + Deserialize, +)] pub struct Scrypt; impl HashingAlgorithm for Scrypt { @@ -32,12 +43,16 @@ impl HashingAlgorithm for Scrypt { /// /// Returns a `Result` containing the hashed password as a vector of bytes. /// If hashing fails for some reason, it returns a `String` detailing the error. - fn hash_password(password: &str, salt: &str) -> Result, String> { + fn hash_password( + password: &str, + salt: &str, + ) -> Result, String> { // The `Params` struct is initialized with specific parameters that define the // computational cost of the hashing process. The parameters used here are chosen // to provide a balance between security and performance. Adjust these values based // on the security requirements and the expected computational capacity. - let params = Params::new(14, 8, 1, 64).map_err(|e| e.to_string())?; + let params = + Params::new(14, 8, 1, 64).map_err(|e| e.to_string())?; let mut output = [0u8; 64]; scrypt( password.as_bytes(), diff --git a/src/lib.rs b/src/lib.rs index d83b16d..0174850 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -70,16 +70,14 @@ //! ```rust //! use hsh::models::hash::Hash; // Import the Hash struct //! -//! fn main() { -//! let password = "password123"; -//! let salt = "somesalt"; -//! let algo = "argon2i"; -//! -//! let original_hash = Hash::new(password, salt, algo).expect("Failed to create hash"); -//! let hashed_password = original_hash.hash.clone(); -//! -//! assert_eq!(original_hash.hash(), &hashed_password); -//! } +//! let password = "password123"; +//! let salt = "somesalt"; +//! let algo = "argon2i"; +// +//! let original_hash = Hash::new(password, salt, algo).expect("Failed to create hash"); +//! let hashed_password = original_hash.hash.clone(); +// +//! assert_eq!(original_hash.hash(), &hashed_password); //! ``` //! //! ## License @@ -89,21 +87,16 @@ //! [banner]: https://kura.pro/hsh/images/banners/banner-hsh.webp //! [crate-shield]: https://img.shields.io/crates/v/hsh.svg?style=for-the-badge&color=success&labelColor=27A006 //! [github-shield]: https://img.shields.io/badge/github-555555?style=for-the-badge&labelColor=000000&logo=github -//! [lib-rs-shield]: https://img.shields.io/badge/lib.rs-v0.0.7-success.svg?style=for-the-badge&color=8A48FF&labelColor=6F36E4 +//! [lib-rs-shield]: https://img.shields.io/badge/lib.rs-v0.0.8-success.svg?style=for-the-badge&color=8A48FF&labelColor=6F36E4 //! [license-shield]: https://img.shields.io/crates/l/hsh.svg?style=for-the-badge&color=007EC6&labelColor=03589B //! [rust-shield]: https://img.shields.io/badge/rust-f04041?style=for-the-badge&labelColor=c0282d&logo=rust //! -//! [00]: https://hshlib.one/ +//! [00]: https://hshlib.com/ //! [01]: https://minifunctions.com/ //! [02]: http://www.apache.org/licenses/LICENSE-2.0 //! [03]: http://opensource.org/licenses/MIT #![cfg_attr(feature = "bench", feature(test))] -#![deny(missing_debug_implementations)] -#![deny(missing_docs)] -#![deny(unsafe_code)] -#![warn(clippy::all)] -#![warn(rust_2018_idioms)] #![doc( html_favicon_url = "https://kura.pro/hsh/images/favicon.ico", html_logo_url = "https://kura.pro/hsh/images/logos/hsh.svg", diff --git a/src/macros.rs b/src/macros.rs index 7050f6d..afb6b81 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -315,7 +315,7 @@ macro_rules! to_str_error { macro_rules! random_string { ($len:expr) => {{ let chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - let mut rng = vrd::Random::default(); + let mut rng = vrd::random::Random::default(); (0..$len as usize) .map(|_| { let index = vrd::rand_int!(rng, 0, (chars.len() - 1) as i32) as usize; @@ -447,7 +447,7 @@ macro_rules! hash_length { macro_rules! macro_log_info { ($level:expr, $component:expr, $description:expr, $format:expr) => {{ use dtt::DateTime; - use vrd::Random; + use vrd::random::Random; use $crate::loggers::{Log, LogFormat, LogLevel}; // Get the current date and time in ISO 8601 format. @@ -467,7 +467,6 @@ macro_rules! macro_log_info { $format, ); let _ = log.log(); - log // Return the Log instance }}; } diff --git a/src/models/hash.rs b/src/models/hash.rs index dd0e177..e4d35a4 100644 --- a/src/models/hash.rs +++ b/src/models/hash.rs @@ -1,12 +1,11 @@ // Copyright © 2023 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT -use serde::{Deserialize, Serialize}; use super::hash_algorithm::HashAlgorithm; use crate::algorithms; use crate::models::hash_algorithm::HashingAlgorithm; use algorithms::{argon2i::Argon2i, bcrypt::Bcrypt, scrypt::Scrypt}; -use std::convert::TryInto; +use serde::{Deserialize, Serialize}; // use algorithms::{argon2i::Argon2i, bcrypt::Bcrypt, scrypt::Scrypt}; use argon2rs::argon2i_simple; @@ -14,8 +13,7 @@ use base64::{engine::general_purpose, Engine as _}; // use models::{hash::*, hash_algorithm::*}; use scrypt::scrypt; use std::{fmt, str::FromStr}; -use vrd::Random; - +use vrd::random::Random; /// A type alias for a salt. pub type Salt = Vec; @@ -60,13 +58,17 @@ impl Hash { /// Err(e) => println!("An error occurred: {}", e), /// } /// ``` - pub fn new_argon2i(password: &str, salt: Salt) -> Result { + pub fn new_argon2i( + password: &str, + salt: Salt, + ) -> Result { // Convert the Vec salt to a &str let salt_str = std::str::from_utf8(&salt) .map_err(|_| "Failed to convert salt to string")?; // Perform Argon2i hashing - let calculated_hash = argon2i_simple(password, salt_str).to_vec(); + let calculated_hash = + argon2i_simple(password, salt_str).to_vec(); HashBuilder::new() .hash(calculated_hash) @@ -91,10 +93,15 @@ impl Hash { /// Err(e) => println!("An error occurred: {}", e), /// } /// ``` - pub fn new_bcrypt(password: &str, cost: u32) -> Result { + pub fn new_bcrypt( + password: &str, + cost: u32, + ) -> Result { // Perform Bcrypt hashing - let hashed_password = bcrypt::hash(password, cost) - .map_err(|e| format!("Failed to hash password with Bcrypt: {}", e))?; + let hashed_password = + bcrypt::hash(password, cost).map_err(|e| { + format!("Failed to hash password with Bcrypt: {}", e) + })?; // In Bcrypt, the salt is embedded in the hashed password. // So, you can just use an empty salt when building the Hash object. @@ -123,13 +130,17 @@ impl Hash { /// Err(e) => println!("An error occurred: {}", e), /// } /// ``` - pub fn new_scrypt(password: &str, salt: Salt) -> Result { + pub fn new_scrypt( + password: &str, + salt: Salt, + ) -> Result { // Convert the Vec salt to a &str for hashing let salt_str = std::str::from_utf8(&salt) .map_err(|_| "Failed to convert salt to string")?; // Perform Scrypt hashing using a wrapper function that sets the parameters - let calculated_hash = algorithms::scrypt::Scrypt::hash_password(password, salt_str)?; + let calculated_hash = + Scrypt::hash_password(password, salt_str)?; // Use the builder pattern to construct the Hash instance HashBuilder::new() @@ -362,11 +373,15 @@ impl Hash { match self.algorithm { HashAlgorithm::Argon2i => { // Hash the password once - let calculated_hash = argon2i_simple(password, salt).to_vec(); + let calculated_hash = + argon2i_simple(password, salt).to_vec(); // Debugging information println!("Algorithm: Argon2i"); - println!("Provided password for verification: {}", password); + println!( + "Provided password for verification: {}", + password + ); println!("Salt used for verification: {}", salt); println!("Calculated Hash: {:?}", calculated_hash); println!("Stored Hash: {:?}", self.hash); @@ -377,7 +392,10 @@ impl Hash { HashAlgorithm::Bcrypt => { // Debugging information println!("Algorithm: Bcrypt"); - println!("Provided password for verification: {}", password); + println!( + "Provided password for verification: {}", + password + ); let hash_str = std::str::from_utf8(&self.hash) .map_err(|_| "Failed to convert hash to string")?; @@ -387,11 +405,16 @@ impl Hash { HashAlgorithm::Scrypt => { // Debugging information println!("Algorithm: Scrypt"); - println!("Provided password for verification: {}", password); + println!( + "Provided password for verification: {}", + password + ); println!("Salt used for verification: {}", salt); let scrypt_params = scrypt::Params::new(14, 8, 1, 64) - .map_err(|_| "Failed to create Scrypt params")?; + .map_err(|_| { + "Failed to create Scrypt params" + })?; let mut output = [0u8; 64]; match scrypt( password.as_bytes(), @@ -400,7 +423,10 @@ impl Hash { &mut output, ) { Ok(_) => { - println!("Calculated Hash: {:?}", output.to_vec()); + println!( + "Calculated Hash: {:?}", + output.to_vec() + ); println!("Stored Hash: {:?}", self.hash); Ok(output.to_vec() == self.hash) } @@ -409,7 +435,6 @@ impl Hash { } } } - } impl fmt::Display for Hash { @@ -495,7 +520,9 @@ impl HashBuilder { /// Consumes the builder and returns a `Hash` if all fields are set. /// Otherwise, it returns an error. pub fn build(self) -> Result { - if let (Some(hash), Some(salt), Some(algorithm)) = (self.hash, self.salt, self.algorithm) { + if let (Some(hash), Some(salt), Some(algorithm)) = + (self.hash, self.salt, self.algorithm) + { Ok(Hash { hash, salt, @@ -513,4 +540,3 @@ impl Default for HashBuilder { Self::new() } } - diff --git a/src/models/hash_algorithm.rs b/src/models/hash_algorithm.rs index 1bf7340..51251e2 100644 --- a/src/models/hash_algorithm.rs +++ b/src/models/hash_algorithm.rs @@ -8,7 +8,18 @@ use serde::{Deserialize, Serialize}; /// This enum is used to specify which hashing algorithm should be used /// when creating a new hashed password. /// -#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize, Deserialize)] +#[derive( + Clone, + Copy, + Debug, + Eq, + Hash, + Ord, + PartialEq, + PartialOrd, + Serialize, + Deserialize, +)] pub enum HashAlgorithm { /// Argon2i - A memory-hard password hashing algorithm. /// @@ -61,7 +72,8 @@ pub trait HashingAlgorithm { /// /// Returns a `Result` containing the hashed password as a vector of bytes. /// If hashing fails, returns a `String` detailing the error. - fn hash_password(password: &str, salt: &str) -> Result, String>; + fn hash_password( + password: &str, + salt: &str, + ) -> Result, String>; } - - diff --git a/src/models/mod.rs b/src/models/mod.rs index ced1a95..b566866 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -5,4 +5,4 @@ pub mod hash; /// The `hash_algorithm` module contains the `HashAlgorithm` enum. -pub mod hash_algorithm; \ No newline at end of file +pub mod hash_algorithm; diff --git a/tests/test_argon2i.rs b/tests/test_argon2i.rs index 6574c73..f28fc3e 100644 --- a/tests/test_argon2i.rs +++ b/tests/test_argon2i.rs @@ -9,7 +9,11 @@ mod tests { fn test_hash_differs_from_password() { let password = "password123"; let salt = "somesalt"; - let hashed_password = hsh::algorithms::argon2i::Argon2i::hash_password(password, salt).unwrap(); + let hashed_password = + hsh::algorithms::argon2i::Argon2i::hash_password( + password, salt, + ) + .unwrap(); assert_ne!(hashed_password, password.as_bytes()); } @@ -20,11 +24,15 @@ mod tests { let salt1 = "salt123456789012345678901234567"; let salt2 = "salt234567890123456789012345678"; - let hash1 = hsh::algorithms::argon2i::Argon2i::hash_password(password, salt1).unwrap(); - let hash2 = hsh::algorithms::argon2i::Argon2i::hash_password(password, salt2).unwrap(); + let hash1 = hsh::algorithms::argon2i::Argon2i::hash_password( + password, salt1, + ) + .unwrap(); + let hash2 = hsh::algorithms::argon2i::Argon2i::hash_password( + password, salt2, + ) + .unwrap(); assert_ne!(hash1, hash2); } - - } diff --git a/tests/test_bcrypt.rs b/tests/test_bcrypt.rs index c45cdb7..8dbd4eb 100644 --- a/tests/test_bcrypt.rs +++ b/tests/test_bcrypt.rs @@ -1,8 +1,6 @@ - // Copyright © 2023 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT - #[cfg(test)] mod tests { use hsh::models::hash_algorithm::HashingAlgorithm; @@ -11,7 +9,11 @@ mod tests { fn test_hash_differs_from_password() { let password = "password123"; let salt = "somesalt"; - let hashed_password = hsh::algorithms::bcrypt::Bcrypt::hash_password(password, salt).unwrap(); + let hashed_password = + hsh::algorithms::bcrypt::Bcrypt::hash_password( + password, salt, + ) + .unwrap(); assert_ne!(hashed_password, password.as_bytes()); } @@ -22,8 +24,14 @@ mod tests { let salt1 = "salt1"; let salt2 = "salt2"; - let hash1 = hsh::algorithms::bcrypt::Bcrypt::hash_password(password, salt1).unwrap(); - let hash2 = hsh::algorithms::bcrypt::Bcrypt::hash_password(password, salt2).unwrap(); + let hash1 = hsh::algorithms::bcrypt::Bcrypt::hash_password( + password, salt1, + ) + .unwrap(); + let hash2 = hsh::algorithms::bcrypt::Bcrypt::hash_password( + password, salt2, + ) + .unwrap(); assert_ne!(hash1, hash2); } @@ -39,4 +47,4 @@ mod tests { assert!(result.is_err()); } -} \ No newline at end of file +} diff --git a/tests/test_hash.rs b/tests/test_hash.rs index 2dd836a..9d7ab3a 100644 --- a/tests/test_hash.rs +++ b/tests/test_hash.rs @@ -3,8 +3,8 @@ #[cfg(test)] mod tests { - use hsh::models::hash_algorithm::HashAlgorithm; use hsh::models::hash::{Hash, HashBuilder, Salt}; + use hsh::models::hash_algorithm::HashAlgorithm; use std::str::FromStr; #[test] diff --git a/tests/test_hash_algorithm.rs b/tests/test_hash_algorithm.rs index 28c7daf..16e78b5 100644 --- a/tests/test_hash_algorithm.rs +++ b/tests/test_hash_algorithm.rs @@ -3,14 +3,19 @@ #[cfg(test)] mod tests { - use hsh::models::hash_algorithm::{HashAlgorithm, HashingAlgorithm}; + use hsh::models::hash_algorithm::{ + HashAlgorithm, HashingAlgorithm, + }; // Dummy struct to implement HashingAlgorithm for testing struct DummyAlgorithm; impl HashingAlgorithm for DummyAlgorithm { - fn hash_password(_password: &str, _salt: &str) -> Result, String> { - Ok(vec![1, 2, 3, 4]) // Dummy logic + fn hash_password( + _password: &str, + _salt: &str, + ) -> Result, String> { + Ok(vec![1, 2, 3, 4]) // Dummy logic } } @@ -29,7 +34,8 @@ mod tests { fn test_hashing_algorithm_trait() { let password = "password123"; let salt = "salt123"; - let hashed = DummyAlgorithm::hash_password(password, salt).unwrap(); + let hashed = + DummyAlgorithm::hash_password(password, salt).unwrap(); assert_eq!(hashed, vec![1, 2, 3, 4]); } } diff --git a/tests/test_loggers.rs b/tests/test_loggers.rs index 73dfde6..e553b56 100644 --- a/tests/test_loggers.rs +++ b/tests/test_loggers.rs @@ -4,88 +4,85 @@ #[cfg(test)] mod tests { - fn test_macro_log( - level: LogLevel, - component: &str, - description: &str, - format: LogFormat, - ) { - let log = - macro_log_info!(level, component, description, format); - assert_eq!(log.level, level); - assert_eq!(log.component, component); - assert_eq!(log.description, description); - assert_eq!(log.format, format); - } + // fn test_macro_log( + // level: LogLevel, + // component: &str, + // description: &str, + // format: LogFormat, + // ) { + // let log = + // macro_log_info!(level, component, description, format); + // assert_eq!(log.level, level); + // assert_eq!(log.component, component); + // assert_eq!(log.description, description); + // assert_eq!(log.format, format); + // } - #[test] - fn test_macros() { - test_macro_log( - LogLevel::ALL, - "component", - "description", - LogFormat::CLF, - ); - test_macro_log( - LogLevel::DEBUG, - "component", - "description", - LogFormat::CLF, - ); - test_macro_log( - LogLevel::DISABLED, - "component", - "description", - LogFormat::CLF, - ); - test_macro_log( - LogLevel::ERROR, - "component", - "description", - LogFormat::CLF, - ); - test_macro_log( - LogLevel::FATAL, - "component", - "description", - LogFormat::CLF, - ); - test_macro_log( - LogLevel::INFO, - "component", - "description", - LogFormat::CLF, - ); - test_macro_log( - LogLevel::NONE, - "component", - "description", - LogFormat::CLF, - ); - test_macro_log( - LogLevel::TRACE, - "component", - "description", - LogFormat::CLF, - ); - test_macro_log( - LogLevel::VERBOSE, - "component", - "description", - LogFormat::CLF, - ); - test_macro_log( - LogLevel::WARNING, - "component", - "description", - LogFormat::CLF, - ); - } + // #[test] + // fn test_macros() { + // test_macro_log( + // LogLevel::ALL, + // "component", + // "description", + // LogFormat::CLF, + // ); + // test_macro_log( + // LogLevel::DEBUG, + // "component", + // "description", + // LogFormat::CLF, + // ); + // test_macro_log( + // LogLevel::DISABLED, + // "component", + // "description", + // LogFormat::CLF, + // ); + // test_macro_log( + // LogLevel::ERROR, + // "component", + // "description", + // LogFormat::CLF, + // ); + // test_macro_log( + // LogLevel::FATAL, + // "component", + // "description", + // LogFormat::CLF, + // ); + // test_macro_log( + // LogLevel::INFO, + // "component", + // "description", + // LogFormat::CLF, + // ); + // test_macro_log( + // LogLevel::NONE, + // "component", + // "description", + // LogFormat::CLF, + // ); + // test_macro_log( + // LogLevel::TRACE, + // "component", + // "description", + // LogFormat::CLF, + // ); + // test_macro_log( + // LogLevel::VERBOSE, + // "component", + // "description", + // LogFormat::CLF, + // ); + // test_macro_log( + // LogLevel::WARNING, + // "component", + // "description", + // LogFormat::CLF, + // ); + // } - use hsh::{ - loggers::{Log, LogFormat, LogLevel}, - macro_log_info, - }; + use hsh::loggers::{Log, LogFormat, LogLevel}; #[test] fn test_log_level_display() { @@ -129,4 +126,4 @@ mod tests { assert!(log.description.is_empty()); assert_eq!(log.format, LogFormat::CLF); } -} \ No newline at end of file +} diff --git a/tests/test_macros.rs b/tests/test_macros.rs index 07c86e9..606a94a 100644 --- a/tests/test_macros.rs +++ b/tests/test_macros.rs @@ -5,10 +5,9 @@ mod tests { // Importing hsh crate and all of its macros - extern crate hsh; - use hsh::{generate_hash, hash_length, new_hash}; use hsh::models::hash::*; use hsh::models::hash_algorithm::HashAlgorithm; + use hsh::{generate_hash, hash_length, new_hash}; use hsh::{ hsh_assert, hsh_contains, hsh_in_range, hsh_join, hsh_max, hsh_min, hsh_parse, hsh_print, hsh_print_vec, hsh_split, @@ -80,7 +79,6 @@ mod tests { assert!(!hsh_contains!("Hello", "x")); } - #[test] fn macro_hsh_in_range() { let lower_bound = 0; @@ -92,7 +90,6 @@ mod tests { assert!(!hsh_in_range!(test_val2, lower_bound, upper_bound)); } - #[test] fn macro_hsh_parse() { let input: Result = hsh_parse!("42"); diff --git a/tests/test_scrypt.rs b/tests/test_scrypt.rs index 6bddca0..672a67e 100644 --- a/tests/test_scrypt.rs +++ b/tests/test_scrypt.rs @@ -10,7 +10,9 @@ mod tests { let password = "secure_password"; let salt = "random_salt"; - let result = hsh::algorithms::scrypt::Scrypt::hash_password(password, salt); + let result = hsh::algorithms::scrypt::Scrypt::hash_password( + password, salt, + ); assert!(result.is_ok()); } @@ -19,8 +21,16 @@ mod tests { let password = "password123"; let salt = "salt123"; - let hash1_result = hsh::algorithms::scrypt::Scrypt::hash_password(password, salt).unwrap(); - let hash2_result = hsh::algorithms::scrypt::Scrypt::hash_password(password, salt).unwrap(); + let hash1_result = + hsh::algorithms::scrypt::Scrypt::hash_password( + password, salt, + ) + .unwrap(); + let hash2_result = + hsh::algorithms::scrypt::Scrypt::hash_password( + password, salt, + ) + .unwrap(); assert_eq!(hash1_result, hash2_result); } @@ -31,8 +41,16 @@ mod tests { let salt1 = "salt123"; let salt2 = "another_salt123"; - let hash1_result = hsh::algorithms::scrypt::Scrypt::hash_password(password, salt1).unwrap(); - let hash2_result = hsh::algorithms::scrypt::Scrypt::hash_password(password, salt2).unwrap(); + let hash1_result = + hsh::algorithms::scrypt::Scrypt::hash_password( + password, salt1, + ) + .unwrap(); + let hash2_result = + hsh::algorithms::scrypt::Scrypt::hash_password( + password, salt2, + ) + .unwrap(); assert_ne!(hash1_result, hash2_result); } @@ -43,8 +61,16 @@ mod tests { let password2 = "other_password123"; let salt = "salt123"; - let hash1_result = hsh::algorithms::scrypt::Scrypt::hash_password(password1, salt).unwrap(); - let hash2_result = hsh::algorithms::scrypt::Scrypt::hash_password(password2, salt).unwrap(); + let hash1_result = + hsh::algorithms::scrypt::Scrypt::hash_password( + password1, salt, + ) + .unwrap(); + let hash2_result = + hsh::algorithms::scrypt::Scrypt::hash_password( + password2, salt, + ) + .unwrap(); assert_ne!(hash1_result, hash2_result); } diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml deleted file mode 100644 index b4dfa89..0000000 --- a/xtask/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "xtask" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] - -xtaskops = "0.4.2" -anyhow = "1.0.83" - -[[bin]] -name = "xtask" -path = "src/main.rs" diff --git a/xtask/src/main.rs b/xtask/src/main.rs deleted file mode 100644 index 83a5804..0000000 --- a/xtask/src/main.rs +++ /dev/null @@ -1,5 +0,0 @@ -//! xtaskops entrypointFunction: `main` - Main function for xtaskops -fn main() -> Result<(), anyhow::Error> { - // Run the xtaskops main function - xtaskops::tasks::main() -} \ No newline at end of file From eed1bc5415fa5a068bb715ce5ddda70617d22f7b Mon Sep 17 00:00:00 2001 From: Sebastien Rousseau Date: Sat, 11 May 2024 17:22:30 +0100 Subject: [PATCH 2/7] refactor(hsh): :heavy_minus_sign: remove loggers functions --- src/lib.rs | 3 - src/loggers.rs | 243 ------------------------------------------ src/macros.rs | 36 ------- tests/test_loggers.rs | 129 ---------------------- 4 files changed, 411 deletions(-) delete mode 100644 src/loggers.rs delete mode 100644 tests/test_loggers.rs diff --git a/src/lib.rs b/src/lib.rs index 0174850..03fe6e1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -108,9 +108,6 @@ /// The `algorithms` module contains the password hashing algorithms. pub mod algorithms; -/// The `loggers` module contains the loggers for the library. -pub mod loggers; - /// The `macros` module contains functions for generating macros. pub mod macros; diff --git a/src/loggers.rs b/src/loggers.rs deleted file mode 100644 index 78be83b..0000000 --- a/src/loggers.rs +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 OR MIT - -// Standard library imports for formatting and I/O operations. -use std::{ - fmt, - fs::OpenOptions, - io::{self, Write as IoWrite}, -}; - -/// Enum representing the different log formats that can be used. -/// -/// This enum allows the developer to specify the format in which log messages should be displayed. -/// -#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, PartialOrd)] -pub enum LogFormat { - /// The log format is set to the Common Log Format (CLF) - CLF, - /// The log format is set to the JSON format - JSON, - /// The log format is set to the Common Event Format (CEF) - CEF, - /// The log format is set to the Extended Log Format (ELF) - ELF, - /// The log format is set to the W3C Extended Log File Format - W3C, - /// The log format is set to the Graylog Extended Log Format (GELF) - GELF, -} - -/// Implements Display trait for `LogFormat` enum. -/// -/// This allows easy conversion of the log format enums to strings. -impl fmt::Display for LogFormat { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - writeln!(f, "{self:?}") - } -} - -/// An enumeration of the different levels that a log message can have. -/// Each variant of the enumeration represents a different level of -/// importance. -/// -/// # Arguments -/// -/// * `ALL` - The log level is set to all. -/// * `DEBUG` - The log level is set to debug. -/// * `DISABLED` - The log level is set to disabled. -/// * `ERROR` - The log level is set to error. -/// * `FATAL` - The log level is set to fatal. -/// * `INFO` - The log level is set to info. -/// * `NONE` - The log level is set to none. -/// * `TRACE` - The log level is set to trace. -/// * `VERBOSE` - The log level is set to verbose. -/// * `WARNING` - The log level is set to warning. -/// -#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, PartialOrd)] -pub enum LogLevel { - /// The log level is set to all. - ALL, - /// The log level is set to debug. - DEBUG, - /// The log level is set to disabled. - DISABLED, - /// The log level is set to error. - ERROR, - /// The log level is set to fatal. - FATAL, - /// The log level is set to info. - INFO, - /// The log level is set to none. - NONE, - /// The log level is set to trace. - TRACE, - /// The log level is set to verbose. - VERBOSE, - /// The log level is set to warning. - WARNING, -} -/// Display trait implementation for `LogLevel`. -/// -/// This converts the enum to a string representation. -impl fmt::Display for LogLevel { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "{self:?}") - } -} - -/// Struct representing a log message. -/// -/// Contains all the elements that make up a complete log message. -#[derive(Debug, PartialEq, Eq, Hash, Clone)] -pub struct Log { - /// A string that holds a session ID. The session ID is a unique - /// identifier for the current session. A random GUID (Globally - /// Unique Identifier) is generated by default. - pub session_id: String, - /// A string that holds the timestamp in ISO 8601 format. - pub time: String, - /// A string that holds the level (INFO, WARN, ERROR, etc.). - pub level: LogLevel, - /// A string that holds the component name. - pub component: String, - /// A string that holds the description of the log message. - pub description: String, - /// A string that holds the log format. - pub format: LogFormat, -} - -impl Log { - /// Logs a message to the console using a pre-allocated buffer to - /// reduce memory allocation and flush the output buffer to ensure - /// that the message is written immediately. - /// - /// # Errors - /// - /// This function will panic if an error occurs when writing to the - /// pre-allocated buffer or flushing the output buffer. - pub fn log(&self) -> io::Result<()> { - // Open the file in append mode. If the file does not exist, create it. - let mut file = OpenOptions::new() - .write(true) - .truncate(true) - .open("xtasks.log")?; - match self.format { - LogFormat::CLF => { - writeln!( - file, - "SessionID={}\tTimestamp={}\tDescription={}\tLevel={}\tComponent={}\tFormat={}", - self.session_id, - self.time, - self.description, - self.level, - self.component, - self.format - ) - } - LogFormat::JSON => { - writeln!( - file, - r#"{{"session_id": "{}", "timestamp": "{}", "description": "{}", "level": "{}", "component": "{}", "format": "{}"}}"#, - self.session_id, - self.time, - self.description, - self.level, - self.component, - self.format - ) - } - LogFormat::CEF => { - writeln!( - file, - r#"[CEF] - - 1 - xtasks - Application - {} - Log - {} - {} - {} - localhost - localhost - - - - - - - - - - - - - - "#, - self.time, - self.level, - self.description, - self.session_id - ) - } - _ => Err(io::Error::new( - io::ErrorKind::InvalidInput, - "Unsupported log format", - )), - }?; - file.flush()?; - Ok(()) - } - - /// Creates a new `Log` instance. - /// - /// Initializes a new `Log` struct with the provided details. - /// - /// # Returns - /// - /// Returns a new instance of the `Log` struct. - pub fn new( - session_id: &str, - time: &str, - level: LogLevel, - component: &str, - description: &str, - format: LogFormat, - ) -> Self { - Self { - session_id: session_id.to_string(), - time: time.to_string(), - level, - component: component.to_string(), - description: description.to_string(), - format, - } - } -} - -/// Provides default values for `Log`. -/// -/// This implementation provides a quick way to generate a `Log` instance with default values. -impl Default for Log { - fn default() -> Self { - Self { - session_id: String::default(), - time: String::default(), - level: LogLevel::INFO, // Default log level - component: String::default(), - description: String::default(), - format: LogFormat::CLF, // Default log format - } - } -} -#[cfg(test)] -/// Tests for the `log_info!` macro. -mod tests { - use crate::macro_log_info; - - #[test] - fn test_log_info() { - macro_log_info!( - LogLevel::INFO, - "component", - "description", - LogFormat::CLF - ); - } -} diff --git a/src/macros.rs b/src/macros.rs index afb6b81..9a9f470 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -434,42 +434,6 @@ macro_rules! hash_length { }; } -/// Custom logging macro for various log levels and formats. -/// -/// # Parameters -/// -/// * `$level`: The log level of the message. -/// * `$component`: The component where the log is coming from. -/// * `$description`: A description of the log message. -/// * `$format`: The format of the log message. -/// -#[macro_export] -macro_rules! macro_log_info { - ($level:expr, $component:expr, $description:expr, $format:expr) => {{ - use dtt::DateTime; - use vrd::random::Random; - use $crate::loggers::{Log, LogFormat, LogLevel}; - - // Get the current date and time in ISO 8601 format. - let date = DateTime::new(); - let iso = date.iso_8601; - - // Create a new random number generator - let mut rng = Random::default(); - let session_id = rng.rand().to_string(); - - let log = Log::new( - &session_id, - &iso, - $level, - $component, - $description, - $format, - ); - let _ = log.log(); - }}; -} - /// Macros related to executing shell commands. /// /// Executes a shell command, logs the start and completion of the operation, and handles any errors that occur. diff --git a/tests/test_loggers.rs b/tests/test_loggers.rs deleted file mode 100644 index e553b56..0000000 --- a/tests/test_loggers.rs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. -// SPDX-License-Identifier: Apache-2.0 OR MIT - -#[cfg(test)] -mod tests { - - // fn test_macro_log( - // level: LogLevel, - // component: &str, - // description: &str, - // format: LogFormat, - // ) { - // let log = - // macro_log_info!(level, component, description, format); - // assert_eq!(log.level, level); - // assert_eq!(log.component, component); - // assert_eq!(log.description, description); - // assert_eq!(log.format, format); - // } - - // #[test] - // fn test_macros() { - // test_macro_log( - // LogLevel::ALL, - // "component", - // "description", - // LogFormat::CLF, - // ); - // test_macro_log( - // LogLevel::DEBUG, - // "component", - // "description", - // LogFormat::CLF, - // ); - // test_macro_log( - // LogLevel::DISABLED, - // "component", - // "description", - // LogFormat::CLF, - // ); - // test_macro_log( - // LogLevel::ERROR, - // "component", - // "description", - // LogFormat::CLF, - // ); - // test_macro_log( - // LogLevel::FATAL, - // "component", - // "description", - // LogFormat::CLF, - // ); - // test_macro_log( - // LogLevel::INFO, - // "component", - // "description", - // LogFormat::CLF, - // ); - // test_macro_log( - // LogLevel::NONE, - // "component", - // "description", - // LogFormat::CLF, - // ); - // test_macro_log( - // LogLevel::TRACE, - // "component", - // "description", - // LogFormat::CLF, - // ); - // test_macro_log( - // LogLevel::VERBOSE, - // "component", - // "description", - // LogFormat::CLF, - // ); - // test_macro_log( - // LogLevel::WARNING, - // "component", - // "description", - // LogFormat::CLF, - // ); - // } - - use hsh::loggers::{Log, LogFormat, LogLevel}; - - #[test] - fn test_log_level_display() { - let level = LogLevel::INFO; - assert_eq!(format!("{level}"), "INFO"); - } - - #[test] - fn test_log_format_display() { - let format = LogFormat::JSON; - assert_eq!(format!("{format}"), "JSON\n"); - } - - #[test] - fn test_log_new() { - let log = Log::new( - "session123", - "2023-02-28T12:34:56Z", - LogLevel::WARNING, - "auth", - "Invalid credentials", - LogFormat::CLF, - ); - - assert_eq!(log.session_id, "session123"); - assert_eq!(log.time, "2023-02-28T12:34:56Z"); - assert_eq!(log.level, LogLevel::WARNING); - assert_eq!(log.component, "auth"); - assert_eq!(log.description, "Invalid credentials"); - assert_eq!(log.format, LogFormat::CLF); - } - - #[test] - fn test_log_default() { - let log = Log::default(); - - assert!(log.session_id.is_empty()); - assert!(log.time.is_empty()); - assert_eq!(log.level, LogLevel::INFO); - assert!(log.component.is_empty()); - assert!(log.description.is_empty()); - assert_eq!(log.format, LogFormat::CLF); - } -} From f3cd20fc79fde90aa2119d12c9acfb1f9ffde1bf Mon Sep 17 00:00:00 2001 From: Sebastien Rousseau Date: Sun, 12 May 2024 07:50:29 +0100 Subject: [PATCH 3/7] test(hsh): :white_check_mark: add new tests for `test_argon2i.rs` and updated copyrights --- benches/criterion.rs | 2 +- build.rs | 2 +- examples/hsh.rs | 2 +- src/algorithms/argon2i.rs | 2 +- src/algorithms/bcrypt.rs | 2 +- src/algorithms/mod.rs | 2 +- src/algorithms/scrypt.rs | 2 +- src/lib.rs | 4 +- src/macros.rs | 2 +- src/main.rs | 2 +- src/models/hash.rs | 2 +- src/models/hash_algorithm.rs | 2 +- src/models/mod.rs | 2 +- tests/test_argon2i.rs | 80 +++++++++++++++++++++++++++++------- tests/test_bcrypt.rs | 2 +- tests/test_hash.rs | 2 +- tests/test_hash_algorithm.rs | 2 +- tests/test_lib.rs | 2 +- tests/test_macros.rs | 2 +- tests/test_main.rs | 2 +- tests/test_scrypt.rs | 2 +- 21 files changed, 87 insertions(+), 35 deletions(-) diff --git a/benches/criterion.rs b/benches/criterion.rs index df0f47b..7d32af6 100644 --- a/benches/criterion.rs +++ b/benches/criterion.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT //! Benchmarking the Hash (HSH) library using Criterion.rs diff --git a/build.rs b/build.rs index a01e740..079c268 100644 --- a/build.rs +++ b/build.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT //! This is the main function for the build script. diff --git a/examples/hsh.rs b/examples/hsh.rs index bc67a0e..8433fbd 100644 --- a/examples/hsh.rs +++ b/examples/hsh.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT //! Using the Hash (HSH) library diff --git a/src/algorithms/argon2i.rs b/src/algorithms/argon2i.rs index 96d4569..67f3494 100644 --- a/src/algorithms/argon2i.rs +++ b/src/algorithms/argon2i.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT use crate::models::hash_algorithm::HashingAlgorithm; diff --git a/src/algorithms/bcrypt.rs b/src/algorithms/bcrypt.rs index 7ef7b0d..53499b5 100644 --- a/src/algorithms/bcrypt.rs +++ b/src/algorithms/bcrypt.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT use crate::models::hash_algorithm::HashingAlgorithm; diff --git a/src/algorithms/mod.rs b/src/algorithms/mod.rs index 3aa2a53..b93b137 100644 --- a/src/algorithms/mod.rs +++ b/src/algorithms/mod.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT /// The `argon2i` module contains the Argon2i password hashing algorithm. diff --git a/src/algorithms/scrypt.rs b/src/algorithms/scrypt.rs index 6a00c25..62a8e26 100644 --- a/src/algorithms/scrypt.rs +++ b/src/algorithms/scrypt.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT use crate::models::hash_algorithm::HashingAlgorithm; diff --git a/src/lib.rs b/src/lib.rs index 03fe6e1..9005f96 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,7 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT //! # Hash (HSH), a Quantum-Resistant Cryptographic Hash Library diff --git a/src/macros.rs b/src/macros.rs index 9a9f470..7f205e2 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT //! # Macros for the `hsh` crate. diff --git a/src/main.rs b/src/main.rs index a51380a..4943888 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT //! This is the main entry point for the hsh application. diff --git a/src/models/hash.rs b/src/models/hash.rs index e4d35a4..d6f9d44 100644 --- a/src/models/hash.rs +++ b/src/models/hash.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT use super::hash_algorithm::HashAlgorithm; diff --git a/src/models/hash_algorithm.rs b/src/models/hash_algorithm.rs index 51251e2..71fa0be 100644 --- a/src/models/hash_algorithm.rs +++ b/src/models/hash_algorithm.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT use serde::{Deserialize, Serialize}; diff --git a/src/models/mod.rs b/src/models/mod.rs index b566866..d028106 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT /// The `data` module contains the structs. diff --git a/tests/test_argon2i.rs b/tests/test_argon2i.rs index f28fc3e..9fedfed 100644 --- a/tests/test_argon2i.rs +++ b/tests/test_argon2i.rs @@ -1,19 +1,20 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT #[cfg(test)] mod tests { - use hsh::models::hash_algorithm::HashingAlgorithm; + use hsh::algorithms::argon2i::Argon2i; + use hsh::models::hash::Hash; + use hsh::models::hash_algorithm::{ + HashAlgorithm, HashingAlgorithm, + }; #[test] fn test_hash_differs_from_password() { let password = "password123"; let salt = "somesalt"; let hashed_password = - hsh::algorithms::argon2i::Argon2i::hash_password( - password, salt, - ) - .unwrap(); + Argon2i::hash_password(password, salt).unwrap(); assert_ne!(hashed_password, password.as_bytes()); } @@ -24,15 +25,66 @@ mod tests { let salt1 = "salt123456789012345678901234567"; let salt2 = "salt234567890123456789012345678"; - let hash1 = hsh::algorithms::argon2i::Argon2i::hash_password( - password, salt1, - ) - .unwrap(); - let hash2 = hsh::algorithms::argon2i::Argon2i::hash_password( - password, salt2, - ) - .unwrap(); + let hash1 = Argon2i::hash_password(password, salt1).unwrap(); + let hash2 = Argon2i::hash_password(password, salt2).unwrap(); assert_ne!(hash1, hash2); } + + #[test] + fn test_same_password_and_salt_produce_same_hash() { + let password = "password123"; + let salt = "somesalt"; + + let hash1 = Argon2i::hash_password(password, salt).unwrap(); + let hash2 = Argon2i::hash_password(password, salt).unwrap(); + + assert_eq!(hash1, hash2); + } + + #[test] + fn test_hash_password_length() { + let password = "password123"; + let salt = "somesalt"; + let hashed_password = + Argon2i::hash_password(password, salt).unwrap(); + + assert_eq!(hashed_password.len(), 32); // Assuming a 32-byte hash + } + + #[test] + fn test_hash_password_not_empty() { + let password = "password123"; + let salt = "somesalt"; + let hashed_password = + Argon2i::hash_password(password, salt).unwrap(); + + assert!(!hashed_password.is_empty()); + } + + #[test] + fn test_hash_password_error() { + let password = "password123"; + let salt = "somesalt"; + let hashed_password = + Argon2i::hash_password(password, salt).unwrap(); + + assert!(!hashed_password.is_empty()); + } + + #[test] + fn test_from_hash() { + let hash_bytes = vec![1, 2, 3, 4]; + let hash = Hash::from_hash(&hash_bytes, "argon2i").unwrap(); + assert_eq!(hash.hash, hash_bytes); + assert_eq!(hash.algorithm, HashAlgorithm::Argon2i); + } + + #[test] + fn test_from_hash_error() { + let hash_bytes = vec![1, 2, 3, 4]; + let hash = Hash::from_hash(&hash_bytes, "argon2i").unwrap(); + assert_eq!(hash.hash, hash_bytes); + assert_eq!(hash.algorithm, HashAlgorithm::Argon2i); + } } diff --git a/tests/test_bcrypt.rs b/tests/test_bcrypt.rs index 8dbd4eb..07f83f2 100644 --- a/tests/test_bcrypt.rs +++ b/tests/test_bcrypt.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT #[cfg(test)] diff --git a/tests/test_hash.rs b/tests/test_hash.rs index 9d7ab3a..4674f01 100644 --- a/tests/test_hash.rs +++ b/tests/test_hash.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT #[cfg(test)] diff --git a/tests/test_hash_algorithm.rs b/tests/test_hash_algorithm.rs index 16e78b5..0c6ea42 100644 --- a/tests/test_hash_algorithm.rs +++ b/tests/test_hash_algorithm.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT #[cfg(test)] diff --git a/tests/test_lib.rs b/tests/test_lib.rs index 20c659c..25e4ae2 100644 --- a/tests/test_lib.rs +++ b/tests/test_lib.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT #[cfg(test)] diff --git a/tests/test_macros.rs b/tests/test_macros.rs index 606a94a..1b803e4 100644 --- a/tests/test_macros.rs +++ b/tests/test_macros.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT #[cfg(test)] diff --git a/tests/test_main.rs b/tests/test_main.rs index 8e2ef0c..3aba91c 100644 --- a/tests/test_main.rs +++ b/tests/test_main.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT #[cfg(test)] diff --git a/tests/test_scrypt.rs b/tests/test_scrypt.rs index 672a67e..c09a739 100644 --- a/tests/test_scrypt.rs +++ b/tests/test_scrypt.rs @@ -1,4 +1,4 @@ -// Copyright © 2023 Hash (HSH) library. All rights reserved. +// Copyright © 2023-2024 Hash (HSH) library. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT #[cfg(test)] From 6822fe1dac3c375a8f6d347d0cbb263fdee1d6a7 Mon Sep 17 00:00:00 2001 From: Sebastien Rousseau Date: Sun, 12 May 2024 07:56:23 +0100 Subject: [PATCH 4/7] test(hsh): :white_check_mark: add new unit tests for `test_bcrypt` --- tests/test_bcrypt.rs | 67 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 14 deletions(-) diff --git a/tests/test_bcrypt.rs b/tests/test_bcrypt.rs index 07f83f2..8534d4e 100644 --- a/tests/test_bcrypt.rs +++ b/tests/test_bcrypt.rs @@ -3,17 +3,18 @@ #[cfg(test)] mod tests { - use hsh::models::hash_algorithm::HashingAlgorithm; + use hsh::algorithms::bcrypt::Bcrypt; + use hsh::models::hash::Hash; + use hsh::models::hash_algorithm::{ + HashAlgorithm, HashingAlgorithm, + }; #[test] fn test_hash_differs_from_password() { let password = "password123"; let salt = "somesalt"; let hashed_password = - hsh::algorithms::bcrypt::Bcrypt::hash_password( - password, salt, - ) - .unwrap(); + Bcrypt::hash_password(password, salt).unwrap(); assert_ne!(hashed_password, password.as_bytes()); } @@ -24,14 +25,8 @@ mod tests { let salt1 = "salt1"; let salt2 = "salt2"; - let hash1 = hsh::algorithms::bcrypt::Bcrypt::hash_password( - password, salt1, - ) - .unwrap(); - let hash2 = hsh::algorithms::bcrypt::Bcrypt::hash_password( - password, salt2, - ) - .unwrap(); + let hash1 = Bcrypt::hash_password(password, salt1).unwrap(); + let hash2 = Bcrypt::hash_password(password, salt2).unwrap(); assert_ne!(hash1, hash2); } @@ -42,9 +37,53 @@ mod tests { let password = "password123"; // Intentionally using an invalid cost to force an error - let invalid_cost = 1; + let invalid_cost: u32 = 1; let result = bcrypt::hash(password, invalid_cost); assert!(result.is_err()); } + + #[test] + fn test_new_bcrypt() { + let password = "password123"; + let cost: u32 = 12; + let hash = Hash::new_bcrypt(password, cost).unwrap(); + + assert_eq!(hash.algorithm, HashAlgorithm::Bcrypt); + assert!(!hash.hash.is_empty()); + assert_eq!(hash.salt.len(), 0); + } + + #[test] + fn test_new_bcrypt_error() { + let password = "password123"; + let invalid_cost: u32 = 0; + let result = Hash::new_bcrypt(password, invalid_cost); + + assert!(result.is_err()); + } + + #[test] + fn test_from_hash() { + let hash_bytes = vec![1, 2, 3, 4]; + let hash = Hash::from_hash(&hash_bytes, "bcrypt").unwrap(); + assert_eq!(hash.hash, hash_bytes); + assert_eq!(hash.algorithm, HashAlgorithm::Bcrypt); + } + + #[test] + fn test_from_hash_error() { + let hash_bytes = vec![1, 2, 3, 4]; + let hash = Hash::from_hash(&hash_bytes, "invalid").unwrap_err(); + assert_eq!(hash, "Unsupported hash algorithm: invalid"); + } + + #[test] + fn test_verify_bcrypt() { + let password = "password123"; + let hash = Hash::new_bcrypt(password, 12).unwrap(); + + assert!(hash.verify(password).unwrap()); + assert!(!hash.verify("wrong_password").unwrap()); + } } From bab11d4bd9afb6801d7a09bad144873f3ac0665d Mon Sep 17 00:00:00 2001 From: Sebastien Rousseau Date: Sun, 12 May 2024 07:56:48 +0100 Subject: [PATCH 5/7] test(hsh): :white_check_mark: add new unit tests for `test_bcrypt` --- tests/test_bcrypt.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_bcrypt.rs b/tests/test_bcrypt.rs index 8534d4e..0a6a6a8 100644 --- a/tests/test_bcrypt.rs +++ b/tests/test_bcrypt.rs @@ -4,7 +4,8 @@ #[cfg(test)] mod tests { use hsh::algorithms::bcrypt::Bcrypt; - use hsh::models::hash::Hash; + use hsh::models::hash:: + Hash; use hsh::models::hash_algorithm::{ HashAlgorithm, HashingAlgorithm, }; From 049ccf70789ed8df5c3f3b42557e8b41991fa813 Mon Sep 17 00:00:00 2001 From: Sebastien Rousseau Date: Sun, 12 May 2024 08:00:59 +0100 Subject: [PATCH 6/7] docs(hsh): :memo: update `README.md` with platform support --- README.md | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index c14c6a6..1527642 100644 --- a/README.md +++ b/README.md @@ -117,43 +117,12 @@ It takes just a few minutes to get up and running with `hsh`. ### Requirements The minimum supported Rust toolchain version is currently Rust -**1.69.0** or later (stable). It is recommended that you install the +**1.60** or later (stable). It is recommended that you install the latest stable version of Rust. ### Platform support -`Hash (HSH)` is supported and tested on the following platforms: - -### Tier 1 platforms 🏆 - -| | Operating System | Target | Description | -| --- | --- | --- | --- | -| ✅ | Linux | aarch64-unknown-linux-gnu | 64-bit Linux systems on ARM architecture | -| ✅ | Linux | i686-unknown-linux-gnu | 32-bit Linux (kernel 3.2+, glibc 2.17+) | -| ✅ | Linux | x86_64-unknown-linux-gnu | 64-bit Linux (kernel 2.6.32+, glibc 2.11+) | -| ✅ | macOS | x86_64-apple-darwin | 64-bit macOS (10.7 Lion or later) | -| ✅ | Windows | i686-pc-windows-gnu | 32-bit Windows (7 or later) | -| ✅ | Windows | i686-pc-windows-msvc | 32-bit Windows (7 or later) | -| ✅ | Windows | x86_64-pc-windows-gnu | 64-bit Windows (7 or later) | -| ✅ | Windows | x86_64-pc-windows-msvc | 64-bit Windows (7 or later) | - -### Tier 2 platforms 🥈 - -| | Operating System | Target | Description | -| --- | --- | --- | --- | -| ✅ | Linux | aarch64-unknown-linux-musl | 64-bit Linux systems on ARM architecture | -| ✅ | Linux | arm-unknown-linux-gnueabi | ARMv6 Linux (kernel 3.2, glibc 2.17) | -| ✅ | Linux | arm-unknown-linux-gnueabihf | ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17) | -| ✅ | Linux | armv7-unknown-linux-gnueabihf | ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17) | -| ✅ | Linux | mips-unknown-linux-gnu | MIPS Linux (kernel 2.6.32+, glibc 2.11+) | -| ✅ | Linux | mips64-unknown-linux-gnuabi64 | MIPS64 Linux (kernel 2.6.32+, glibc 2.11+) | -| ✅ | Linux | mips64el-unknown-linux-gnuabi64 | MIPS64 Linux (kernel 2.6.32+, glibc 2.11+) | -| ✅ | Linux | mipsel-unknown-linux-gnu | MIPS Linux (kernel 2.6.32+, glibc 2.11+) | -| ✅ | macOS | aarch64-apple-darwin | 64-bit macOS (10.7 Lion or later) | -| ✅ | Windows | aarch64-pc-windows-msvc | 64-bit Windows (7 or later) | - -The [GitHub Actions][10] shows the platforms in which the -`Hash (HSH)` library tests are run. +`hsh` supports a variety of CPU architectures. It is supported and tested on MacOS, Linux, and Windows. ### Documentation From 270ee8e1088264a6a813bc2f1e56dd79dd9b96a3 Mon Sep 17 00:00:00 2001 From: Sebastien Rousseau Date: Sun, 12 May 2024 08:03:24 +0100 Subject: [PATCH 7/7] fix(hsh): :bug: fix Expected: 80; Actual: 103 --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1527642..db19e98 100644 --- a/README.md +++ b/README.md @@ -122,7 +122,8 @@ latest stable version of Rust. ### Platform support -`hsh` supports a variety of CPU architectures. It is supported and tested on MacOS, Linux, and Windows. +`hsh` supports a variety of CPU architectures. It is supported and tested on +MacOS, Linux, and Windows. ### Documentation