diff --git a/.codacy.yml b/.codacy.yml
new file mode 100644
index 0000000..2ed27d2
--- /dev/null
+++ b/.codacy.yml
@@ -0,0 +1,10 @@
+exclude_paths:
+ - ".github/**"
+ - ".config/**"
+ - "coverage/**"
+ - "vendor/**"
+ - "docs/**"
+ - "examples/**"
+ - "assets/**"
+ - "tests/**"
+ - "benchmarks/**"
diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
new file mode 100644
index 0000000..c94b373
--- /dev/null
+++ b/.config/dotnet-tools.json
@@ -0,0 +1,27 @@
+{
+ "version": 1,
+ "isRoot": true,
+ "tools": {
+ "dotnet-coverage": {
+ "version": "18.1.0",
+ "commands": [
+ "dotnet-coverage"
+ ],
+ "rollForward": false
+ },
+ "dotnet-stryker": {
+ "version": "4.12.0",
+ "commands": [
+ "dotnet-stryker"
+ ],
+ "rollForward": false
+ },
+ "docfx": {
+ "version": "2.78.4",
+ "commands": [
+ "docfx"
+ ],
+ "rollForward": false
+ }
+ }
+}
\ No newline at end of file
diff --git a/.editorconfig b/.editorconfig
index a6e5446..c20e19f 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -79,5 +79,4 @@ csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
-
-file_header_template = /*\nThe MIT License (MIT)\nCopyright (c) 2006 Damien Miller djm@mindrot.org (jBCrypt)\nCopyright (c) 2013 Ryan D. Emerle (.Net port)\nCopyright (c) 2016/2025 Chris McKee (.Net-core port / patches / new features)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files\n(the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,\nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n*/
\ No newline at end of file
+file_header_template = /*\nThe MIT License (MIT)\nCopyright (c) 2006 Damien Miller djm@mindrot.org (jBCrypt)\nCopyright (c) 2013 Ryan D. Emerle (.Net port)\nCopyright (c) 2016 Chris McKee (.Net-core port / patches / new features)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files\n(the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,\nmerge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n*/
\ No newline at end of file
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 0000000..a6eb98e
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1 @@
+* @chrismckee
\ No newline at end of file
diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml
new file mode 100644
index 0000000..8c1458c
--- /dev/null
+++ b/.github/codeql/codeql-config.yml
@@ -0,0 +1,6 @@
+paths:
+ - 'src'
+paths-ignore:
+ - '**/examples/**'
+ - '**/benchmarks/**'
+ - '**/tests/**'
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 97cc51f..5a60d04 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -9,12 +9,8 @@ updates:
update-types: ["version-update:semver-major"]
- dependency-name: "System.Runtime.Caching"
update-types: ["version-update:semver-major"]
- reviewers:
- - "chrismckee"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
- reviewers:
- - "chrismckee"
diff --git a/.github/workflows/ci-build-pr.yml b/.github/workflows/ci-build-pr.yml
new file mode 100644
index 0000000..b225489
--- /dev/null
+++ b/.github/workflows/ci-build-pr.yml
@@ -0,0 +1,106 @@
+name: CI PR Build
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - 'main'
+ paths-ignore:
+ - 'docs/**'
+ - '.github/**'
+ pull_request:
+ branches:
+ - 'main'
+ paths-ignore:
+ - 'docs/**'
+ - '.github/**'
+
+
+permissions:
+ contents: read
+ issues: read
+ pull-requests: write
+ checks: write
+
+env:
+ DOTNET_NOLOGO: true
+ DOTNET_GENERATE_ASPNET_CERTIFICATE: false
+ DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
+
+jobs:
+ build:
+ name: Build and Test
+ runs-on: ubuntu-24.04
+ steps:
+ - name: 'Harden Runner'
+ uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
+ with:
+ egress-policy: audit
+
+ - name: 'Checkout'
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
+
+ - name: 'Setup .NET SDK'
+ uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
+ with:
+ dotnet-version: 10.x
+
+ - name: 'Restore external dependencies'
+ run: dotnet restore
+
+ - name: 'Build'
+ id: build
+ run: dotnet build --configuration Debug --no-restore
+
+ - name: 'Test'
+ id: test
+ run: dotnet run --configuration Release --coverage --coverage-output-format cobertura --report-github --project tests/UnitTests/BCrypt.Net.UnitTests.csproj
+
+ - name: 'Generate Coverage Reports'
+ uses: danielpalme/ReportGenerator-GitHub-Action@c4c5175a441c6603ec614f5084386dabe0e2295b # v5.4.12
+ with:
+ reports: "tests/**/*.cobertura.xml"
+ targetdir: "${{ github.workspace }}"
+ reporttypes: "Cobertura"
+ verbosity: "Info"
+ title: "Code Coverage"
+ tag: "${{ github.run_number }}_${{ github.run_id }}"
+ toolpath: "reportgeneratortool"
+ license: ${{ secrets.REPORT_GENERATOR_LICENSE }}
+
+ - name: Publish Code Coverage Report
+ uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0
+ with:
+ filename: "Cobertura.xml"
+ badge: true
+ fail_below_min: false # just informative for now
+ format: markdown
+ hide_branch_rate: false
+ hide_complexity: false
+ indicators: true
+ output: both
+ thresholds: "10 30"
+
+ - name: Upload Code Coverage Results
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+ with:
+ name: coverage-results
+ path: |
+ ${{ github.workspace }}/Cobertura.xml
+ ${{ github.workspace }}/code-coverage-results.md
+ retention-days: 5
+
+ - name: Publish Test Results
+ uses: EnricoMi/publish-unit-test-result-action@afb2984f4d89672b2f9d9c13ae23d53779671984 # v2.19.0
+ if: always()
+ with:
+ files: "tests/**/TestResults.xml"
+
+ - name: Upload Test Artifacts
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+ with:
+ name: test-results
+ path: "tests/**/TestResults.xml"
+ retention-days: 5
diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml
index 7df381f..d92aadf 100644
--- a/.github/workflows/ci-build.yml
+++ b/.github/workflows/ci-build.yml
@@ -8,9 +8,7 @@ on:
paths-ignore:
- 'docs/**'
- '.github/**'
- pull_request:
- branches:
- - 'main'
+
permissions:
contents: read
@@ -29,19 +27,19 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: 'Harden Runner'
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
+ uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: 'Checkout'
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: 'Setup .NET SDK'
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
+ uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
with:
- dotnet-version: 9.0.x
+ dotnet-version: 10.0.x
- name: 'Restore external dependencies'
run: dotnet restore
@@ -56,14 +54,11 @@ jobs:
name: build-artifacts
path: |
src/**/BCrypt.*.nupkg
- src/**/BCrypt.*.dll
- src/**/BCrypt.*.deps.json
- src/**/BCrypt.*.xml
retention-days: 5
- name: 'Test'
id: test
- run: dotnet test --restore --collect:"XPlat Code Coverage" --logger junit --configuration Debug
+ run: dotnet run --configuration Release --coverage --coverage-output-format cobertura --report-github --project tests/UnitTests/BCrypt.Net.UnitTests.csproj
- name: 'Create test summary'
uses: test-summary/action@31493c76ec9e7aa675f1585d3ed6f1da69269a86 # v2.4
@@ -73,9 +68,9 @@ jobs:
if: always()
- name: 'Generate Coverage Reports'
- uses: danielpalme/ReportGenerator-GitHub-Action@cc137d2b561c02b63ae869ffbe8f68af9d904bf4 # 5.4.6
+ uses: danielpalme/ReportGenerator-GitHub-Action@c4c5175a441c6603ec614f5084386dabe0e2295b # v5.4.12
with:
- reports: "tests/**/coverage.cobertura.xml"
+ reports: "tests/**/*.cobertura.xml"
targetdir: "${{ github.workspace }}"
reporttypes: "Cobertura"
verbosity: "Info"
diff --git a/.github/workflows/ci-manual-build-test-sign.yml b/.github/workflows/ci-manual-build-test-sign.yml
deleted file mode 100644
index 6557bbc..0000000
--- a/.github/workflows/ci-manual-build-test-sign.yml
+++ /dev/null
@@ -1,121 +0,0 @@
-name: Manual Build, Test, Sign, Publish
-on:
- workflow_dispatch:
- inputs:
- public_release:
- description: 'Public Release'
- type: boolean
- required: true
- default: true
- perform_sign:
- description: 'Sign'
- type: boolean
- required: true
- default: true
- perform_publish:
- description: 'nuget publish'
- type: boolean
- required: true
- default: false
-
-env:
- DOTNET_NOLOGO: true
- DOTNET_GENERATE_ASPNET_CERTIFICATE: false
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- DOTNET_CLI_TELEMETRY_OPTOUT: true
- nupkgDirectory: ${{ github.workspace}}/dists
-
-jobs:
- build:
- permissions:
- contents: read
-
- name: Build release
- runs-on: ubuntu-latest
- steps:
- - name: Harden Runner
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
- with:
- egress-policy: audit
-
- - name: 'Checkout repository'
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- with:
- fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
-
- - name: 'Setup .NET SDK'
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
- with:
- dotnet-version: 9.0.x
-
- - name: 'Build'
- run: dotnet build --configuration Release --property:PublicRelease=${{ inputs.public_release }}
-
- - name: 'Test'
- run: dotnet test --configuration Release --no-restore --no-build --property:PublicRelease=${{ inputs.public_release }} tests/UnitTests/BCrypt.Net.UnitTests.csproj
-
- - name: 'Pack release'
- run: dotnet pack --configuration Release --no-restore --no-build --output ${{ env.nupkgDirectory }} --property:PublicRelease=${{ inputs.public_release }}
-
- - name: 'List artifact directory'
- shell: pwsh
- run: >
- Get-ChildItem -Path ${{ env.nupkgDirectory }} -Recurse -Force
-
- - name: 'Extract SBOMs'
- shell: pwsh
- run: >
- Get-ChildItem -Path ${{ env.nupkgDirectory }} -Filter *.nupkg -Force | ForEach-Object {
- Expand-Archive $_.FullName "$($_.DirectoryName)/$($_.Basename)" -Force
- Copy-Item "$($_.DirectoryName)/$($_.Basename)/_manifest/spdx_2.2/manifest.spdx.json" -Destination "${{ env.nupkgDirectory }}/$($_.Basename).spdx.json"
- Copy-Item "$($_.DirectoryName)/$($_.Basename)/_manifest/spdx_2.2/manifest.spdx.json.sha256" -Destination "${{ env.nupkgDirectory }}/$($_.Basename).spdx.json.sha256"
- Remove-Item "$($_.DirectoryName)/$($_.Basename)" -Force -Recurse }
-
- - name: 'List artifact directory'
- shell: pwsh
- run: >
- Get-ChildItem -Path ${{ env.nupkgDirectory }} -Recurse -Force
-
- - name: Upload unsigned nupkgs
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
- with:
- name: build-artifacts
- path: ${{ env.nupkgDirectory }}/*
- retention-days: 7
-
- # publish:
- # name: Publish to nuget
- # needs: sign
- # runs-on: ubuntu-latest
- # if: ${{ inputs.perform_publish }}
- # environment: release
- # permissions:
- # id-token: write
- # steps:
- # - name: 'Harden Runner'
- # uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
- # with:
- # egress-policy: audit
-
- # - name: 'Setup .NET SDK'
- # uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
-
- # - name: 'Gather nupkgs from signing output'
- # uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
- # with:
- # name: signed-artifacts
- # path : ${{ env.nupkgDirectory }}
-
- # - name: List assets to be published
- # shell: pwsh
- # run: >
- # Get-ChildItem -Path ${{ env.nupkgDirectory }} -Filter *.nupkg -Recurse -Force
-
- # # Use --skip-duplicate to prevent errors if a package with the same version already exists.
- # # This allows a retry of a failed workflow, already published packages will be skipped without error.
- # - name: Publish NuGet package
- # shell: pwsh
- # run: >
- # foreach($file in (Get-ChildItem "${{ env.nupkgDirectory }}" -Recurse -Filter *.nupkg)) {
- # dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
- # }
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 98a4b83..68a140a 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -12,6 +12,7 @@ on:
- 'assets/*'
- 'examples/*'
- 'dists/*'
+ - 'benchmarks/*'
pull_request:
# The branches below must be a subset of the branches above
branches:
@@ -23,6 +24,7 @@ on:
- 'assets/*'
- 'examples/*'
- 'dists/*'
+ - 'benchmarks/*'
schedule:
- cron: '25 4 * * 2'
@@ -49,25 +51,27 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
+ uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: 'Checkout repository'
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: 'Setup .NET SDK'
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
+ uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
with:
- dotnet-version: 9.0.x
+ dotnet-version: 10.x
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@d68b2d4edb4189fd2a5366ac14e72027bd4b37dd # v3.28.2
+ uses: github/codeql-action/init@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3
+
with:
languages: ${{ matrix.language }}
+ config-file: ./.github/codeql/codeql-config.yml
# We can't use autobuild because we want to restrict the build to just src folder solutions
# and avoid triggering deterministic builds and git commit based versioning
@@ -75,4 +79,5 @@ jobs:
- run: dotnet build --configuration CodeQL /p:UseSharedCompilation=false /t:rebuild
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@d68b2d4edb4189fd2a5366ac14e72027bd4b37dd # v3.28.2
+ uses: github/codeql-action/analyze@9e907b5e64f6b83e7804b09294d44122997950d6 # v4.32.3
+
diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml
index f3ab11f..5020768 100644
--- a/.github/workflows/dependency-review.yml
+++ b/.github/workflows/dependency-review.yml
@@ -14,12 +14,12 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Harden Runner
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
+ uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: 'Checkout Repository'
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: 'Dependency Review'
- uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
+ uses: actions/dependency-review-action@595b5aeba73380359d98a5e087f648dbb0edce1b # v4.7.3
diff --git a/.github/workflows/devskim.yml b/.github/workflows/devskim.yml
index 3e31856..a3e7267 100644
--- a/.github/workflows/devskim.yml
+++ b/.github/workflows/devskim.yml
@@ -17,12 +17,16 @@ jobs:
dependency-review:
runs-on: ubuntu-24.04
steps:
- - name: Harden Runner
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
+ - name: 'Harden Runner'
+ uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- - uses: actions/checkout@v4
- - uses: microsoft/DevSkim-Action@v1
- - uses: github/codeql-action/upload-sarif@v3
+
+ - name: 'Checkout'
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
+ - uses: microsoft/DevSkim-Action@4b5047945a44163b94642a1cecc0d93a3f428cc6 #v1.0.16
+ - uses: github/codeql-action/upload-sarif@9e907b5e64f6b83e7804b09294d44122997950d6 #v4.32.3
with:
sarif_file: devskim-results.sarif
\ No newline at end of file
diff --git a/.github/workflows/generate-publish-docs.yml b/.github/workflows/generate-publish-docs.yml
index 971a58e..a60a895 100644
--- a/.github/workflows/generate-publish-docs.yml
+++ b/.github/workflows/generate-publish-docs.yml
@@ -30,25 +30,25 @@ jobs:
steps:
- name: Harden Runner
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
+ uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
- name: 'Checkout'
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: 'Setup .NET SDK'
- uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
+ uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
with:
- dotnet-version: 9.0.x
+ dotnet-version: 10.0.x
- run: dotnet tool update -g docfx
- run: docfx ./docs/docfx.json
- name: Upload Pages Artifact
- uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
+ uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
with:
# Upload entire repository
path: './docs/_site'
diff --git a/.github/workflows/infersharp.yml b/.github/workflows/infersharp.yml
new file mode 100644
index 0000000..ff5326e
--- /dev/null
+++ b/.github/workflows/infersharp.yml
@@ -0,0 +1,66 @@
+name: Infer#
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - main
+ paths-ignore:
+ - '**.md'
+ - 'docs/**'
+ - '.github/**'
+ pull_request:
+ branches:
+ - main
+ paths-ignore:
+ - '**.md'
+ - 'docs/**'
+ - '.github/**'
+
+permissions:
+ contents: read
+ security-events: write
+
+env:
+ DOTNET_NOLOGO: true
+ DOTNET_GENERATE_ASPNET_CERTIFICATE: false
+ DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
+
+jobs:
+ infersharp:
+ name: Infer# Analysis
+ runs-on: ubuntu-24.04
+ steps:
+ - name: Harden Runner
+ uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
+ with:
+ egress-policy: audit
+
+ - name: Checkout
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ fetch-depth: 0
+
+ - name: Setup .NET SDK
+ uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
+ with:
+ dotnet-version: 8.x
+
+ - name: Setup .NET SDK
+ uses: actions/setup-dotnet@baa11fbfe1d6520db94683bd5c7a3818018e4309 # v5.1.0
+ with:
+ dotnet-version: 10.x
+
+ - name: Build
+ run: dotnet build src/BCrypt.Net/BCrypt.Net.csproj --configuration Release --framework net8.0
+
+ - name: Run Infer#
+ uses: microsoft/infersharpaction@b749060de518f410f92c87d37d2366e5e9d7c5fc #v1.5
+ id: runinfersharp
+ with:
+ binary-path: src/BCrypt.Net/bin/Release/net8.0
+
+ - name: Upload SARIF to GitHub Security
+ uses: github/codeql-action/upload-sarif@d3678e237b9c32a6c9bffb3315c335f976f3549f # v3.30.2
+ with:
+ sarif_file: infer-out/report.sarif
diff --git a/.github/workflows/markdown-link-check.yml b/.github/workflows/markdown-link-check.yml
deleted file mode 100644
index 0eec6ce..0000000
--- a/.github/workflows/markdown-link-check.yml
+++ /dev/null
@@ -1,37 +0,0 @@
-name: Markdown Links Check
-
-on:
- workflow_dispatch:
- push:
- branches:
- - 'main'
- paths:
- - '**.md'
- pull_request:
- branches:
- - main
- paths:
- - '**.md'
- #schedule:
- # Run every-day at 9:00 AM (See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07)
- #- cron: "0 9 * * *"
-permissions:
- contents: read
-
-jobs:
- markdown-link-check:
- runs-on: ubuntu-24.04
- steps:
- - name: Harden Runner
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
- with:
- egress-policy: audit
-
- - name: 'Checkout Repository'
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
-
- - name: 'Check for dead links in markdown files'
- uses: gaurav-nelson/github-action-markdown-link-check@1b916f2cf6c36510a6059943104e3c42ce6c16bc # 1.0.16
- with:
- use-quiet-mode: 'yes'
- use-verbose-mode: 'no'
diff --git a/.github/workflows/upload-coverage-report.yml b/.github/workflows/upload-coverage-report.yml
index c887166..83216aa 100644
--- a/.github/workflows/upload-coverage-report.yml
+++ b/.github/workflows/upload-coverage-report.yml
@@ -18,7 +18,7 @@ jobs:
github.event.workflow_run.conclusion == 'success'
steps:
- name: Harden Runner
- uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
+ uses: step-security/harden-runner@5ef0c079ce82195b2a36a210272d6b661572d83e # v2.14.2
with:
egress-policy: audit
@@ -28,7 +28,7 @@ jobs:
name: coverage-results
- name: Add Code Coverage PR Comment
- uses: marocchino/sticky-pull-request-comment@67d0dec7b07ed060a405f9b2a64b8ab319fdd7db # v2.9.2
+ uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
if: github.event_name == 'pull_request'
with:
recreate: true
diff --git a/.gitignore b/.gitignore
index 94e51cc..6525e58 100644
--- a/.gitignore
+++ b/.gitignore
@@ -266,3 +266,9 @@ __pycache__/
/src/Benchmark/BenchmarkDotNet.Artifacts/results/*
/docs/_site/
/assets/*.nupkg
+
+/benchmark/BenchmarkDotNet.Artifacts
+/examples/Api/WebApi/app.db*
+BenchmarkDotNet.Artifacts
+/benchmark-releases/ReleaseBenchmark/Generated/*.cs
+**/Generated/VersionInfo.cs
diff --git a/BCrypt.Net.sln b/BCrypt.Net.sln
index cee3569..195d306 100644
--- a/BCrypt.Net.sln
+++ b/BCrypt.Net.sln
@@ -1,21 +1,20 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.29709.97
+# Visual Studio Version 18
+VisualStudioVersion = 18.3.11505.172 d18.3
MinimumVisualStudioVersion = 15.0.26228.4
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BCrypt.Net", "src\BCrypt.Net\BCrypt.Net.csproj", "{CD69F016-5940-4FCA-BCA1-9D1D87C6F873}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTests", "tests\UnitTests\BCrypt.Net.UnitTests.csproj", "{2078EB7B-7EDF-4B65-80F7-DB4D92E08CCD}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BCrypt.Net.UnitTests", "tests\UnitTests\BCrypt.Net.UnitTests.csproj", "{2078EB7B-7EDF-4B65-80F7-DB4D92E08CCD}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build-tools", "build-tools", "{6F3D5F8B-CD73-474C-BA79-D4A17E9F106D}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".build-tools", ".build-tools", "{6F3D5F8B-CD73-474C-BA79-D4A17E9F106D}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
- Dockerfile = Dockerfile
+ Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
+ Dockerfile = Dockerfile
EndProjectSection
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmark", "benchmark\BCryptNet.BenchMarks.csproj", "{E75AA3B8-BF28-4366-B5C6-14AF342290C3}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{DBAB6D93-7DE4-4A70-89E7-1EE784C1A466}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExampleConsoleApp", "examples\ConsoleApp\ExampleConsoleApp\ExampleConsoleApp.csproj", "{A24DEBF7-6ED9-4774-B67F-7A0EE18125C5}"
@@ -26,59 +25,122 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BCrypt.Net.IdentityExtensio
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{93729F4E-5F15-4769-8385-19176C7AAA2C}"
ProjectSection(SolutionItems) = preProject
- .github\dependabot.yml = .github\dependabot.yml
.github\ISSUE_TEMPLATE\bug_report.md = .github\ISSUE_TEMPLATE\bug_report.md
- .github\ISSUE_TEMPLATE\docs-issue.md = .github\ISSUE_TEMPLATE\docs-issue.md
- .github\ISSUE_TEMPLATE\feature_request.md = .github\ISSUE_TEMPLATE\feature_request.md
- .github\stale.yml = .github\stale.yml
.github\workflows\ci-build.yml = .github\workflows\ci-build.yml
- .github\workflows\ci-manual-build-test-sign.yml = .github\workflows\ci-manual-build-test-sign.yml
.github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml
+ .github\dependabot.yml = .github\dependabot.yml
.github\workflows\dependency-review.yml = .github\workflows\dependency-review.yml
+ .github\ISSUE_TEMPLATE\docs-issue.md = .github\ISSUE_TEMPLATE\docs-issue.md
+ .github\ISSUE_TEMPLATE\feature_request.md = .github\ISSUE_TEMPLATE\feature_request.md
.github\workflows\generate-publish-docs.yml = .github\workflows\generate-publish-docs.yml
- .github\workflows\markdown-link-check.yml = .github\workflows\markdown-link-check.yml
+ .github\stale.yml = .github\stale.yml
.github\workflows\upload-coverage-report.yml = .github\workflows\upload-coverage-report.yml
EndProjectSection
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AndroidTest", "examples\AndroidTest\AndroidTest.csproj", "{AEA6712D-0FAE-4031-8FA7-FDD2A026855A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BCrypt.Net.IdentityExtensions.Tests", "tests\BCrypt.Net.IdentityExtensions.Tests\BCrypt.Net.IdentityExtensions.Tests.csproj", "{03E4D4A1-36B4-4538-A030-3C9141C6A3CF}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", "{4FA4B555-4BA9-49D0-84B2-1D222E0F4498}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Diagnostic-Benchmarks", "benchmarks\Diagnostic-Benchmarks\Diagnostic-Benchmarks.csproj", "{0BFE3C36-05D3-4A96-8694-1179FD705162}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Method-Benchmarks", "benchmarks\Method-Benchmarks\Method-Benchmarks.csproj", "{DC455EE9-99A8-4900-AFBA-661E5EFCE50F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Release-Benchmarks", "benchmarks\Release-Benchmarks\Release-Benchmarks.csproj", "{799531B7-02FD-4ED9-BE76-6BFCB083D780}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ All|Any CPU = All|Any CPU
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
+ Benchmarks|Any CPU = Benchmarks|Any CPU
CodeQL|Any CPU = CodeQL|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {CD69F016-5940-4FCA-BCA1-9D1D87C6F873}.All|Any CPU.ActiveCfg = All|Any CPU
+ {CD69F016-5940-4FCA-BCA1-9D1D87C6F873}.All|Any CPU.Build.0 = All|Any CPU
{CD69F016-5940-4FCA-BCA1-9D1D87C6F873}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CD69F016-5940-4FCA-BCA1-9D1D87C6F873}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CD69F016-5940-4FCA-BCA1-9D1D87C6F873}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CD69F016-5940-4FCA-BCA1-9D1D87C6F873}.Release|Any CPU.Build.0 = Release|Any CPU
- {CD69F016-5940-4FCA-BCA1-9D1D87C6F873}.CodeQL|Any CPU.ActiveCfg = CodeQL|Any CPU
- {CD69F016-5940-4FCA-BCA1-9D1D87C6F873}.CodeQL|Any CPU.Build.0 = CodeQL|Any CPU
+ {CD69F016-5940-4FCA-BCA1-9D1D87C6F873}.Benchmarks|Any CPU.ActiveCfg = Benchmarks|Any CPU
+ {CD69F016-5940-4FCA-BCA1-9D1D87C6F873}.Benchmarks|Any CPU.Build.0 = Benchmarks|Any CPU
+ {CD69F016-5940-4FCA-BCA1-9D1D87C6F873}.CodeQL|Any CPU.ActiveCfg = Release|Any CPU
+ {CD69F016-5940-4FCA-BCA1-9D1D87C6F873}.CodeQL|Any CPU.Build.0 = Release|Any CPU
+ {2078EB7B-7EDF-4B65-80F7-DB4D92E08CCD}.All|Any CPU.ActiveCfg = All|Any CPU
+ {2078EB7B-7EDF-4B65-80F7-DB4D92E08CCD}.All|Any CPU.Build.0 = All|Any CPU
{2078EB7B-7EDF-4B65-80F7-DB4D92E08CCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2078EB7B-7EDF-4B65-80F7-DB4D92E08CCD}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E75AA3B8-BF28-4366-B5C6-14AF342290C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E75AA3B8-BF28-4366-B5C6-14AF342290C3}.Release|Any CPU.Build.0 = Release|Any CPU
- {E75AA3B8-BF28-4366-B5C6-14AF342290C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E75AA3B8-BF28-4366-B5C6-14AF342290C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2078EB7B-7EDF-4B65-80F7-DB4D92E08CCD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2078EB7B-7EDF-4B65-80F7-DB4D92E08CCD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2078EB7B-7EDF-4B65-80F7-DB4D92E08CCD}.Benchmarks|Any CPU.ActiveCfg = Benchmarks|Any CPU
+ {2078EB7B-7EDF-4B65-80F7-DB4D92E08CCD}.Benchmarks|Any CPU.Build.0 = Benchmarks|Any CPU
+ {A24DEBF7-6ED9-4774-B67F-7A0EE18125C5}.All|Any CPU.ActiveCfg = All|Any CPU
+ {A24DEBF7-6ED9-4774-B67F-7A0EE18125C5}.All|Any CPU.Build.0 = All|Any CPU
{A24DEBF7-6ED9-4774-B67F-7A0EE18125C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A24DEBF7-6ED9-4774-B67F-7A0EE18125C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A24DEBF7-6ED9-4774-B67F-7A0EE18125C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A24DEBF7-6ED9-4774-B67F-7A0EE18125C5}.Benchmarks|Any CPU.ActiveCfg = Benchmarks|Any CPU
+ {CE412A71-A08D-4263-8960-664827DA526B}.All|Any CPU.ActiveCfg = All|Any CPU
+ {CE412A71-A08D-4263-8960-664827DA526B}.All|Any CPU.Build.0 = All|Any CPU
{CE412A71-A08D-4263-8960-664827DA526B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CE412A71-A08D-4263-8960-664827DA526B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CE412A71-A08D-4263-8960-664827DA526B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CE412A71-A08D-4263-8960-664827DA526B}.Benchmarks|Any CPU.ActiveCfg = Benchmarks|Any CPU
+ {70440057-8D4E-41B0-8DF7-8A67B4C0EE28}.All|Any CPU.ActiveCfg = All|Any CPU
+ {70440057-8D4E-41B0-8DF7-8A67B4C0EE28}.All|Any CPU.Build.0 = All|Any CPU
{70440057-8D4E-41B0-8DF7-8A67B4C0EE28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{70440057-8D4E-41B0-8DF7-8A67B4C0EE28}.Debug|Any CPU.Build.0 = Debug|Any CPU
{70440057-8D4E-41B0-8DF7-8A67B4C0EE28}.Release|Any CPU.ActiveCfg = Release|Any CPU
{70440057-8D4E-41B0-8DF7-8A67B4C0EE28}.Release|Any CPU.Build.0 = Release|Any CPU
- {70440057-8D4E-41B0-8DF7-8A67B4C0EE28}.CodeQL|Any CPU.ActiveCfg = CodeQL|Any CPU
- {70440057-8D4E-41B0-8DF7-8A67B4C0EE28}.CodeQL|Any CPU.Build.0 = CodeQL|Any CPU
+ {70440057-8D4E-41B0-8DF7-8A67B4C0EE28}.Benchmarks|Any CPU.ActiveCfg = Benchmarks|Any CPU
+ {70440057-8D4E-41B0-8DF7-8A67B4C0EE28}.Benchmarks|Any CPU.Build.0 = Benchmarks|Any CPU
+ {70440057-8D4E-41B0-8DF7-8A67B4C0EE28}.CodeQL|Any CPU.ActiveCfg = Release|Any CPU
+ {70440057-8D4E-41B0-8DF7-8A67B4C0EE28}.CodeQL|Any CPU.Build.0 = Release|Any CPU
+ {AEA6712D-0FAE-4031-8FA7-FDD2A026855A}.All|Any CPU.ActiveCfg = All|Any CPU
+ {AEA6712D-0FAE-4031-8FA7-FDD2A026855A}.All|Any CPU.Build.0 = All|Any CPU
+ {AEA6712D-0FAE-4031-8FA7-FDD2A026855A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AEA6712D-0FAE-4031-8FA7-FDD2A026855A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AEA6712D-0FAE-4031-8FA7-FDD2A026855A}.Benchmarks|Any CPU.ActiveCfg = Benchmarks|Any CPU
+ {03E4D4A1-36B4-4538-A030-3C9141C6A3CF}.All|Any CPU.ActiveCfg = Debug|Any CPU
+ {03E4D4A1-36B4-4538-A030-3C9141C6A3CF}.All|Any CPU.Build.0 = Debug|Any CPU
+ {03E4D4A1-36B4-4538-A030-3C9141C6A3CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {03E4D4A1-36B4-4538-A030-3C9141C6A3CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {03E4D4A1-36B4-4538-A030-3C9141C6A3CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {03E4D4A1-36B4-4538-A030-3C9141C6A3CF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {03E4D4A1-36B4-4538-A030-3C9141C6A3CF}.Benchmarks|Any CPU.ActiveCfg = Benchmarks|Any CPU
+ {03E4D4A1-36B4-4538-A030-3C9141C6A3CF}.Benchmarks|Any CPU.Build.0 = Benchmarks|Any CPU
+ {0BFE3C36-05D3-4A96-8694-1179FD705162}.All|Any CPU.ActiveCfg = All|Any CPU
+ {0BFE3C36-05D3-4A96-8694-1179FD705162}.All|Any CPU.Build.0 = All|Any CPU
+ {0BFE3C36-05D3-4A96-8694-1179FD705162}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0BFE3C36-05D3-4A96-8694-1179FD705162}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0BFE3C36-05D3-4A96-8694-1179FD705162}.Benchmarks|Any CPU.ActiveCfg = Benchmarks|Any CPU
+ {0BFE3C36-05D3-4A96-8694-1179FD705162}.Benchmarks|Any CPU.Build.0 = Benchmarks|Any CPU
+ {DC455EE9-99A8-4900-AFBA-661E5EFCE50F}.All|Any CPU.ActiveCfg = All|Any CPU
+ {DC455EE9-99A8-4900-AFBA-661E5EFCE50F}.All|Any CPU.Build.0 = All|Any CPU
+ {DC455EE9-99A8-4900-AFBA-661E5EFCE50F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DC455EE9-99A8-4900-AFBA-661E5EFCE50F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DC455EE9-99A8-4900-AFBA-661E5EFCE50F}.Benchmarks|Any CPU.ActiveCfg = Benchmarks|Any CPU
+ {DC455EE9-99A8-4900-AFBA-661E5EFCE50F}.Benchmarks|Any CPU.Build.0 = Benchmarks|Any CPU
+ {799531B7-02FD-4ED9-BE76-6BFCB083D780}.All|Any CPU.ActiveCfg = All|Any CPU
+ {799531B7-02FD-4ED9-BE76-6BFCB083D780}.All|Any CPU.Build.0 = All|Any CPU
+ {799531B7-02FD-4ED9-BE76-6BFCB083D780}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {799531B7-02FD-4ED9-BE76-6BFCB083D780}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {799531B7-02FD-4ED9-BE76-6BFCB083D780}.Benchmarks|Any CPU.ActiveCfg = Benchmarks|Any CPU
+ {799531B7-02FD-4ED9-BE76-6BFCB083D780}.Benchmarks|Any CPU.Build.0 = Benchmarks|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {D5ADD1E2-61BB-4575-B5D8-78FB549A4DBC}
- EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A24DEBF7-6ED9-4774-B67F-7A0EE18125C5} = {DBAB6D93-7DE4-4A70-89E7-1EE784C1A466}
{CE412A71-A08D-4263-8960-664827DA526B} = {DBAB6D93-7DE4-4A70-89E7-1EE784C1A466}
{93729F4E-5F15-4769-8385-19176C7AAA2C} = {6F3D5F8B-CD73-474C-BA79-D4A17E9F106D}
+ {AEA6712D-0FAE-4031-8FA7-FDD2A026855A} = {DBAB6D93-7DE4-4A70-89E7-1EE784C1A466}
+ {0BFE3C36-05D3-4A96-8694-1179FD705162} = {4FA4B555-4BA9-49D0-84B2-1D222E0F4498}
+ {DC455EE9-99A8-4900-AFBA-661E5EFCE50F} = {4FA4B555-4BA9-49D0-84B2-1D222E0F4498}
+ {799531B7-02FD-4ED9-BE76-6BFCB083D780} = {4FA4B555-4BA9-49D0-84B2-1D222E0F4498}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {D5ADD1E2-61BB-4575-B5D8-78FB549A4DBC}
EndGlobalSection
EndGlobal
diff --git a/Directory.Build.props b/Directory.Build.props
index c152dcd..75adf20 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -12,7 +12,10 @@
https://github.com/BcryptNet/bcrypt.net/
true
MIT
+ readme.md
bcrypt;BCrypt.Net;cryptography;hashing;password;security,hash;crypto;blowfish;gdpr
+ logo.png
+ readme.md
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 1dacc93..8b2467f 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -4,28 +4,34 @@
false
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
+
+
+
+
diff --git a/Dockerfile b/Dockerfile
index 1b0a00f..d5d483b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,6 @@
-FROM mcr.microsoft.com/dotnet/sdk:9.0 AS test
+FROM mcr.microsoft.com/dotnet/sdk:10.0 AS test
WORKDIR /src
COPY ./ ./
#RUN dotnet test BCrypt.Net.UnitTests
-RUN dotnet build BCrypt.Net.sln -c Benchmark --framework net9.0
-RUN dotnet run --project Benchmark/Benchmark.csproj -c Benchmark --framework net9.0
\ No newline at end of file
+RUN dotnet build BCrypt.Net.sln -c Benchmark --framework net10.0
+RUN dotnet run --project Benchmark/Benchmark.csproj -c Benchmark --framework net10.0
\ No newline at end of file
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..e7c9301
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,27 @@
+#!/usr/bin/make -f
+#SHELL:=/bin/bash
+
+default: help
+help: # Show help for each of the Makefile recipes.
+ @grep -E '^[a-zA-Z0-9 -]+:.*#' Makefile | sort | while read -r l; do printf "\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done
+
+.PHONY: all
+all:
+ @echo "Usage: make [target]"
+ @exit 0
+
+.PHONY: ci-test
+ci-test: ## Run tests in CI with code coverage
+ @dotnet run --configuration Release --coverage --coverage-output-format cobertura --report-github
+
+.PHONY: build-alpha-package
+build-alpha-package: # builds a package with a pre-release version suffix
+ @dotnet pack src/BCrypt.Net/BCrypt.Net.csproj --version-suffix 5.0.0-alpha -o artifacts
+
+.PHONY: build-package
+build-package: # builds a package with the version from the project file
+ @dotnet pack src/BCrypt.Net/BCrypt.Net.csproj -o artifacts
+
+.PHONY: benchmarks
+benchmarks:
+ $(MAKE) -C src/benchmarks/
\ No newline at end of file
diff --git a/bcrypt.pub b/bcrypt.pub
index 400f3b4..21ce884 100644
Binary files a/bcrypt.pub and b/bcrypt.pub differ
diff --git a/bcrypt.snk b/bcrypt.snk
new file mode 100644
index 0000000..400f3b4
Binary files /dev/null and b/bcrypt.snk differ
diff --git a/benchmark/InterrogateHashBenchmarks.cs b/benchmark/InterrogateHashBenchmarks.cs
deleted file mode 100644
index 5660483..0000000
--- a/benchmark/InterrogateHashBenchmarks.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-using BCryptNet.BenchMarks._3._2._1;
-using BCryptNet.BenchMarks.HashParser;
-using BenchmarkDotNet.Attributes;
-
-#pragma warning disable 1591
-
-namespace BCryptNet.BenchMarks
-{
- [MemoryDiagnoser]
- [RPlotExporter, RankColumn]
- [KeepBenchmarkFiles]
- public class InterrogateHashBenchmarks
- {
-
- [Benchmark(Baseline = true)]
- [Arguments("$2a$12$k42ZFHFWqBp3vWli.nIn8uYyIkbvYRvodzbfbK18SSsY.CsIQPlxO")]
- [Arguments( "$2a$10$fVH8e28OQRj9tqiDXs1e1uxpsjN0c7II7YPKXua2NAKYvM6iQk7dq")]
- public void InterrogateHashUsingRegex(string hash)
- {
- BaseLine.BCrypt.InterrogateHash(hash);
- }
-
- [Benchmark()]
- [Arguments("$2a$12$k42ZFHFWqBp3vWli.nIn8uYyIkbvYRvodzbfbK18SSsY.CsIQPlxO")]
- [Arguments( "$2a$10$fVH8e28OQRj9tqiDXs1e1uxpsjN0c7II7YPKXua2NAKYvM6iQk7dq")]
- public void InterrogateHashUsingParser(string hash)
- {
- Decoder.GetHashInformation(hash);
- }
-
- }
-}
diff --git a/benchmark/Program.cs b/benchmark/Program.cs
deleted file mode 100644
index 8d44a48..0000000
--- a/benchmark/Program.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-using System;
-using BenchmarkDotNet.Configs;
-using BenchmarkDotNet.Environments;
-using BenchmarkDotNet.Jobs;
-using BenchmarkDotNet.Running;
-using BenchmarkDotNet.Validators;
-
-#pragma warning disable 1591
-
-namespace BCryptNet.BenchMarks
-{
- class Program
- {
- static void Main(string[] args)
- {
- #if DEBUG
- BenchmarkRunner.Run(new DebugInProcessConfig().AddValidator(ExecutionValidator.FailOnError));
- // BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly)
- // .Run(args, new DebugInProcessConfig()
- // // .With(Job.Default.With(CoreRuntime.Latest))
- // // .With(Job.Default.With(ClrRuntime.Net48))
- // .AddValidator(ExecutionValidator.FailOnError));
- #else
- var config = DefaultConfig.Instance
- .With(Job.Default.With(CoreRuntime.Core60))
- .With(Job.Default.With(ClrRuntime.Net48));
- // BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, config);
-
- BenchmarkRunner.Run(config);
- BenchmarkRunner.Run(config);
-
- // Tests for testing in isolation
- BenchmarkRunner.Run(config);
- BenchmarkRunner.Run(config);
- BenchmarkRunner.Run(config);
- BenchmarkRunner.Run(config);
- #endif
-
- }
- }
-}
diff --git a/benchmark/TestB64Decoder.cs b/benchmark/TestB64Decoder.cs
deleted file mode 100644
index 6c3ac58..0000000
--- a/benchmark/TestB64Decoder.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-using BCryptNet.BenchMarks.DecodeB64;
-using BenchmarkDotNet.Attributes;
-
-#pragma warning disable 1591
-
-namespace BCryptNet.BenchMarks
-{
- [MemoryDiagnoser]
- [RPlotExporter, RankColumn]
- [KeepBenchmarkFiles]
- public class TestB64Decoder
- {
-
- [Benchmark(Baseline = true)]
- [Arguments("DCq7YPn5Rq63x1Lad4cll.")]
- [Arguments("HqWuK6/Ng6sg9gQzbLrgb.")]
- public byte[] DecodeBase64StandardUnSized(string salt)
- {
- return DecodeB64Methods.DecodeBase64StandardUnSized(salt, 16);
- }
-
- [Benchmark]
- [Arguments("DCq7YPn5Rq63x1Lad4cll.")]
- [Arguments("HqWuK6/Ng6sg9gQzbLrgb.")]
- public byte[] DecodeBase64StandardSized(string salt)
- {
- return DecodeB64Methods.DecodeBase64StandardSized(salt, 16);
- }
-
-#if !NETFRAMEWORK
- [Benchmark]
- [Arguments("DCq7YPn5Rq63x1Lad4cll.")]
- [Arguments("HqWuK6/Ng6sg9gQzbLrgb.")]
- public byte[] DecodeBase64StringCreateSpan(string salt)
- {
- return DecodeB64Methods.DecodeBase64StringCreateSpan(salt, 16);
- }
-#else
- [Benchmark(Description = "Deliberately Ignore")]
- [Arguments("DCq7YPn5Rq63x1Lad4cll.")]
- [Arguments("HqWuK6/Ng6sg9gQzbLrgb.")]
- public byte[] DecodeBase64StringCreateSpan(string salt)
- {
- // Deliberately empty https://github.com/dotnet/BenchmarkDotNet/issues/1863#issuecomment-988288587
- return null;
- }
-#endif
-
- [Benchmark]
- [Arguments("DCq7YPn5Rq63x1Lad4cll.")]
- [Arguments("HqWuK6/Ng6sg9gQzbLrgb.")]
- public byte[] DecodeBase64ToBytes(string salt)
- {
- return DecodeB64Methods.DecodeBase64ToBytes(salt, 16);
- }
-
- }
-}
diff --git a/benchmark/TestB64Encoder.cs b/benchmark/TestB64Encoder.cs
deleted file mode 100644
index 5a2f3a7..0000000
--- a/benchmark/TestB64Encoder.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using BCryptNet.BenchMarks._3._2._1;
-using BCryptNet.BenchMarks.EncodeB64;
-using BenchmarkDotNet.Attributes;
-
-#pragma warning disable 1591
-
-namespace BCryptNet.BenchMarks
-{
- [MemoryDiagnoser]
- [RPlotExporter, RankColumn]
- [KeepBenchmarkFiles]
- public class TestB64Encoder
- {
- private static readonly byte[] SaltBytes = BaseLine.BCrypt.DecodeBase64("sGBxdT2q8Qd84NyZEkwTY.", 16);
-
- [Benchmark(Baseline = true)]
- public void EncodeBase64Unsized()
- {
- var decoded = EncodeB64Methods.EncodeBase64Unsized(SaltBytes, 16);
- }
-
- [Benchmark]
- public void EncodeBase64Sized()
- {
- var decoded = EncodeB64Methods.EncodeBase64Sized(SaltBytes, 16);
- }
-
- [Benchmark]
- public void EncodeBase64AsBytes()
- {
- var decoded = EncodeB64Methods.EncodeBase64AsBytes(SaltBytes, 16);
- }
- }
-}
diff --git a/benchmark/TestBcrypt_Hashing.cs b/benchmark/TestBcrypt_Hashing.cs
deleted file mode 100644
index 888724b..0000000
--- a/benchmark/TestBcrypt_Hashing.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-using System.Collections.Generic;
-using BCryptNet.BenchMarks._3._2._1;
-using BCryptNet.BenchMarks._3._5.perfmerge_1;
-using BCryptNet.BenchMarks._4._0._0;
-using BenchmarkDotNet.Attributes;
-
-#pragma warning disable 1591
-
-namespace BCryptNet.BenchMarks
-{
- [MemoryDiagnoser]
- [RPlotExporter, RankColumn]
- [KeepBenchmarkFiles]
- public class TestBcrypt_Hashing
- {
- public IEnumerable