Skip to content

Commit

Permalink
Merge branch 'master' into github_actions_updater
Browse files Browse the repository at this point in the history
  • Loading branch information
Saibamen committed Jan 20, 2025
2 parents e069dbe + 55d8eaf commit 34f1a85
Show file tree
Hide file tree
Showing 59 changed files with 1,407 additions and 2,183 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ env:
PACKAGE_5_FULL: Gandalan.IDAS.Contracts
BUILD_CONFIG: Release
OUTPUT_DIR: ./GDLPackages
RELEASE_NAME: _will_be_set_in_steps_
COMMON_PACK_PARAMS: _will_be_set_in_steps_

jobs:
build-and-publish-nuget:
Expand All @@ -36,40 +38,41 @@ jobs:

- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- name: Set release_name
id: set_release_name
run: echo "release_name=$(date +'%-Y.%-m.%-d').$GITHUB_RUN_NUMBER" >> $GITHUB_OUTPUT
- name: Set env.RELEASE_NAME
run: echo "RELEASE_NAME=$(date +'%-Y.%-m.%-d').$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
- name: Setup .NET Core SDK ${{ env.SDK_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.SDK_VERSION }}
- name: Run UpdateVersionInfo.ps1 with ${{ steps.set_release_name.outputs.release_name }}
- name: Run UpdateVersionInfo.ps1 with ${{ env.RELEASE_NAME }}
shell: pwsh
run: .\UpdateVersionInfo.ps1 ${{ steps.set_release_name.outputs.release_name }}
run: .\UpdateVersionInfo.ps1 ${{ env.RELEASE_NAME }}
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration ${{ env.BUILD_CONFIG }} --no-restore -p:Version=${{ steps.set_release_name.outputs.release_name }}
run: dotnet build --configuration ${{ env.BUILD_CONFIG }} --no-restore -p:Version=${{ env.RELEASE_NAME }}
- name: Set env.COMMON_PACK_PARAMS
run: echo "COMMON_PACK_PARAMS=-NonInteractive -Verbosity Detailed -OutputDirectory ${{ env.OUTPUT_DIR }} -Symbols -SymbolPackageFormat snupkg" >> $GITHUB_ENV
- name: Create package ${{ env.PACKAGE_1 }}
run: nuget pack ${{ env.PACKAGE_1_FULL }}/${{ env.PACKAGE_1 }}.nuspec -NonInteractive -Verbosity Detailed -OutputDirectory ${{ env.OUTPUT_DIR }} -Symbols -SymbolPackageFormat snupkg
run: nuget pack ${{ env.PACKAGE_1_FULL }}/${{ env.PACKAGE_1 }}.nuspec ${{ env.COMMON_PACK_PARAMS }}
- name: Create package ${{ env.PACKAGE_2 }}
run: nuget pack ${{ env.PACKAGE_2_FULL }}/${{ env.PACKAGE_2 }}.nuspec -NonInteractive -Verbosity Detailed -OutputDirectory ${{ env.OUTPUT_DIR }} -Symbols -SymbolPackageFormat snupkg
run: nuget pack ${{ env.PACKAGE_2_FULL }}/${{ env.PACKAGE_2 }}.nuspec ${{ env.COMMON_PACK_PARAMS }}
- name: Create package ${{ env.PACKAGE_3 }}
run: nuget pack ${{ env.PACKAGE_3_FULL }}/${{ env.PACKAGE_3 }}.nuspec -NonInteractive -Verbosity Detailed -OutputDirectory ${{ env.OUTPUT_DIR }} -Symbols -SymbolPackageFormat snupkg
run: nuget pack ${{ env.PACKAGE_3_FULL }}/${{ env.PACKAGE_3 }}.nuspec ${{ env.COMMON_PACK_PARAMS }}
- name: Create package ${{ env.PACKAGE_4 }}
run: nuget pack ${{ env.PACKAGE_4_FULL }}/${{ env.PACKAGE_4 }}.nuspec -NonInteractive -Verbosity Detailed -OutputDirectory ${{ env.OUTPUT_DIR }} -Symbols -SymbolPackageFormat snupkg
run: nuget pack ${{ env.PACKAGE_4_FULL }}/${{ env.PACKAGE_4 }}.nuspec ${{ env.COMMON_PACK_PARAMS }}
- name: Create package ${{ env.PACKAGE_5 }}
run: nuget pack ${{ env.PACKAGE_5_FULL }}/${{ env.PACKAGE_5 }}.nuspec -NonInteractive -Verbosity Detailed -OutputDirectory ${{ env.OUTPUT_DIR }} -Symbols -SymbolPackageFormat snupkg
run: nuget pack ${{ env.PACKAGE_5_FULL }}/${{ env.PACKAGE_5 }}.nuspec ${{ env.COMMON_PACK_PARAMS }}
- name: Push packages
run: dotnet nuget push "${{ env.OUTPUT_DIR }}/*.nupkg" -k ${NUGET_TOKEN} #--skip-duplicate
env:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
- name: Create tag
uses: rickstaa/action-create-tag@v1
with:
tag: IDAS.Client.Libs-Release_${{ steps.set_release_name.outputs.release_name }}
tag: IDAS.Client.Libs-Release_${{ env.RELEASE_NAME }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create release with changelog and assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create "IDAS.Client.Libs-Release_${{ steps.set_release_name.outputs.release_name }}" --generate-notes --prerelease ${{ env.OUTPUT_DIR }}/*.nupkg ${{ env.OUTPUT_DIR }}/*.snupkg
run: gh release create "IDAS.Client.Libs-Release_${{ env.RELEASE_NAME }}" --generate-notes --prerelease ${{ env.OUTPUT_DIR }}/*.nupkg ${{ env.OUTPUT_DIR }}/*.snupkg
25 changes: 14 additions & 11 deletions .github/workflows/check-NuGet-Libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ env:
PACKAGE_5_FULL: Gandalan.IDAS.Contracts
BUILD_CONFIG: Release
OUTPUT_DIR: ./GDLPackages
RELEASE_NAME: _will_be_set_in_steps_
COMMON_PACK_PARAMS: _will_be_set_in_steps_

jobs:
check-nuget-libs:
Expand All @@ -34,27 +36,28 @@ jobs:

- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- name: Set release_name
id: set_release_name
run: echo "release_name=$(date +'%-Y.%-m.%-d').$GITHUB_RUN_NUMBER" >> $GITHUB_OUTPUT
- name: Set env.RELEASE_NAME
run: echo "RELEASE_NAME=$(date +'%-Y.%-m.%-d').$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
- name: Setup .NET Core SDK ${{ env.SDK_VERSION }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.SDK_VERSION }}
- name: Run UpdateVersionInfo.ps1 with ${{ steps.set_release_name.outputs.release_name }}
- name: Run UpdateVersionInfo.ps1 with ${{ env.RELEASE_NAME }}
shell: pwsh
run: .\UpdateVersionInfo.ps1 ${{ steps.set_release_name.outputs.release_name }}
run: .\UpdateVersionInfo.ps1 ${{ env.RELEASE_NAME }}
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration ${{ env.BUILD_CONFIG }} --no-restore -p:Version=${{ steps.set_release_name.outputs.release_name }}
run: dotnet build --configuration ${{ env.BUILD_CONFIG }} --no-restore -p:Version=${{ env.RELEASE_NAME }}
- name: Set env.COMMON_PACK_PARAMS
run: echo "COMMON_PACK_PARAMS=-NonInteractive -Verbosity Detailed -OutputDirectory ${{ env.OUTPUT_DIR }} -Symbols -SymbolPackageFormat snupkg" >> $GITHUB_ENV
- name: Create package ${{ env.PACKAGE_1 }}
run: nuget pack ${{ env.PACKAGE_1_FULL }}/${{ env.PACKAGE_1 }}.nuspec -NonInteractive -Verbosity Detailed -OutputDirectory ${{ env.OUTPUT_DIR }} -Symbols -SymbolPackageFormat snupkg
run: nuget pack ${{ env.PACKAGE_1_FULL }}/${{ env.PACKAGE_1 }}.nuspec ${{ env.COMMON_PACK_PARAMS }}
- name: Create package ${{ env.PACKAGE_2 }}
run: nuget pack ${{ env.PACKAGE_2_FULL }}/${{ env.PACKAGE_2 }}.nuspec -NonInteractive -Verbosity Detailed -OutputDirectory ${{ env.OUTPUT_DIR }} -Symbols -SymbolPackageFormat snupkg
run: nuget pack ${{ env.PACKAGE_2_FULL }}/${{ env.PACKAGE_2 }}.nuspec ${{ env.COMMON_PACK_PARAMS }}
- name: Create package ${{ env.PACKAGE_3 }}
run: nuget pack ${{ env.PACKAGE_3_FULL }}/${{ env.PACKAGE_3 }}.nuspec -NonInteractive -Verbosity Detailed -OutputDirectory ${{ env.OUTPUT_DIR }} -Symbols -SymbolPackageFormat snupkg
run: nuget pack ${{ env.PACKAGE_3_FULL }}/${{ env.PACKAGE_3 }}.nuspec ${{ env.COMMON_PACK_PARAMS }}
- name: Create package ${{ env.PACKAGE_4 }}
run: nuget pack ${{ env.PACKAGE_4_FULL }}/${{ env.PACKAGE_4 }}.nuspec -NonInteractive -Verbosity Detailed -OutputDirectory ${{ env.OUTPUT_DIR }} -Symbols -SymbolPackageFormat snupkg
run: nuget pack ${{ env.PACKAGE_4_FULL }}/${{ env.PACKAGE_4 }}.nuspec ${{ env.COMMON_PACK_PARAMS }}
- name: Create package ${{ env.PACKAGE_5 }}
run: nuget pack ${{ env.PACKAGE_5_FULL }}/${{ env.PACKAGE_5 }}.nuspec -NonInteractive -Verbosity Detailed -OutputDirectory ${{ env.OUTPUT_DIR }} -Symbols -SymbolPackageFormat snupkg
run: nuget pack ${{ env.PACKAGE_5_FULL }}/${{ env.PACKAGE_5 }}.nuspec ${{ env.COMMON_PACK_PARAMS }}
2 changes: 0 additions & 2 deletions .github/workflows/check-weblibs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,5 @@ jobs:
node-version: 22
- run: npm ci
working-directory: ${{ env.WEBLIBS_DIR }}
- run: npm run svelte-check
working-directory: ${{ env.WEBLIBS_DIR }}
- run: npm run lint:prod
working-directory: ${{ env.WEBLIBS_DIR }}
2 changes: 0 additions & 2 deletions .github/workflows/publish-weblibs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ jobs:
registry-url: 'https://registry.npmjs.org'
- run: npm ci
working-directory: ${{ env.WEBLIBS_DIR }}
- run: npm run svelte-check
working-directory: ${{ env.WEBLIBS_DIR }}
- run: npm run lint:prod
working-directory: ${{ env.WEBLIBS_DIR }}
- run: npm publish
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,8 @@ FodyWeavers.xsd

# JetBrains Rider
*.sln.iml
/Gandalan.IDAS.Contracts/GDL.IDAS.Contracts.xml
/Gandalan.IDAS.Crypto/GDL.IDAS.Crypto.xml
/Gandalan.IDAS.Logging/GDL.IDAS.Logging.xml
/Gandalan.IDAS.WebApi.Client.Wpf/GDL.IDAS.WebApi.Client.Wpf.xml
/Gandalan.IDAS.WebApi.Client/GDL.IDAS.WebApi.Client.xml
6 changes: 3 additions & 3 deletions AssemblyProjectInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Reflection;
using System.Reflection;

[assembly: AssemblyCompany("Gandalan GmbH & Co. KG")]
[assembly: AssemblyCopyright("Copyright © Gandalan GmbH & Co. KG, 2014-2024")]
[assembly: AssemblyVersion("19.2.*")]
[assembly: AssemblyCopyright("Copyright © Gandalan GmbH & Co. KG, 2014-2025")]
[assembly: AssemblyVersion("19.2.*")]
16 changes: 9 additions & 7 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<Project>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>CS1998</NoWarn>
</PropertyGroup>
<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>
</Project>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>CS1998</NoWarn>
</PropertyGroup>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>
</Project>
11 changes: 9 additions & 2 deletions Gandalan.IDAS.Contracts/GDL.IDAS.Contracts.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@
<owners>Gandalan GmbH &amp; Co. KG</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Gandalan.IDAS.Contracts</description>
<copyright>Copyright © Gandalan GmbH &amp; Co. KG 2012-2024</copyright>
<copyright>Copyright © Gandalan GmbH &amp; Co. KG 2012-2025</copyright>
<projectUrl>https://github.com/gandalan/idas-client-libs/</projectUrl>
<license type="expression">MIT</license>
<readme>README.md</readme>
<dependencies>
<dependency id="GDL.IDAS.WebApi.Client" version="BUILDVERSION" />
<group targetFramework=".NETFramework4.8">
<dependency id="GDL.IDAS.WebApi.Client" version="BUILDVERSION" />
</group>

<group targetFramework="net8.0">
<dependency id="GDL.IDAS.WebApi.Client" version="BUILDVERSION" />
</group>
</dependencies>
</metadata>
<files>
Expand Down
10 changes: 7 additions & 3 deletions Gandalan.IDAS.Contracts/Gandalan.IDAS.Contracts.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@
<Version>2099.0.0-alpha</Version>
<PackageReadmeFile>README.md</PackageReadmeFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DocumentationFile>..\Gandalan.IDAS.Contracts\GDL.IDAS.Contracts.xml</DocumentationFile>
</PropertyGroup>

<PropertyGroup>
<NoWarn>$(NoWarn);CS1591;</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<WarningsAsErrors>$(WarningsAsErrors);NU1605;CA1416</WarningsAsErrors>
<WarningsAsErrors>$(WarningsAsErrors);NU1605;CA1416;</WarningsAsErrors>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<DocumentationFile>..\Gandalan.IDAS.Contracts\GDL.IDAS.Contracts.xml</DocumentationFile>
<WarningsAsErrors>$(WarningsAsErrors);NU1605;CA1416</WarningsAsErrors>
<WarningsAsErrors>$(WarningsAsErrors);NU1605;CA1416;</WarningsAsErrors>
<NoWarn>CS1572;CS1573;CS1591;</NoWarn>
</PropertyGroup>

Expand Down
6 changes: 3 additions & 3 deletions Gandalan.IDAS.Contracts/Token/JwtTokenService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public class JwtTokenService
private const string ClaimIdasAuthToken = "idasAuthToken";
private const string ClaimRefreshToken = "refreshToken";
private const string ClaimTokenType = "type";
private const string ClaimRole = "role";
private const string ClaimRights = "rights";
public static string ClaimRole = "role";
public static string ClaimRights = "rights";

public JwtTokenService(DateTime? issuedAt = null)
{
Expand Down Expand Up @@ -233,4 +233,4 @@ private static SigningCredentials GetSigningCredentials(string privateKey)
key: new RsaSecurityKey(rsa),
SecurityAlgorithms.RsaSha256Signature);
}
}
}
29 changes: 26 additions & 3 deletions Gandalan.IDAS.Crypto/AESHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public static string EncryptData(string data, string password)
}

/// <summary>
/// Decrypt the data string to the original string. The data must be the base64 string
/// returned from the EncryptData method.
/// Decrypt the data string to the original string. The data must be the base64 string
/// returned from the <see cref="EncryptData(string,string)"/> method.
/// </summary>
/// <param name="data">Encrypted data generated from EncryptData method.</param>
/// <param name="data">Encrypted data generated from <see cref="EncryptData(string,string)"/> method.</param>
/// <param name="password">Password used to decrypt the string.</param>
/// <returns>Decrypted string.</returns>
public static string DecryptData(string data, string password)
Expand All @@ -57,6 +57,17 @@ public static string DecryptData(string data, string password)
return Encoding.UTF8.GetString(decBytes);
}

/// <summary>
/// Encrypts a byte array using AES encryption with the specified password and padding mode.
/// The same password and padding mode must be used to decrypt the data.
/// </summary>
/// <param name="data">The byte array to encrypt.</param>
/// <param name="password">The password used for encryption.</param>
/// <param name="paddingMode">The padding mode to use during encryption.</param>
/// <returns>A byte array containing the encrypted data.</returns>
/// <exception cref="ArgumentNullException">
/// Thrown when <paramref name="data"/> is null or empty, or when <paramref name="password"/> is null.
/// </exception>
public static byte[] EncryptData(byte[] data, string password, PaddingMode paddingMode)
{
if (data == null || data.Length == 0)
Expand Down Expand Up @@ -84,6 +95,18 @@ public static byte[] EncryptData(byte[] data, string password, PaddingMode paddi
}
}

/// <summary>
/// Decrypts an encrypted byte array back to its original byte array using AES decryption.
/// The encrypted data must be created using a compatible encryption method, such as
/// <see cref="EncryptData(byte[], string, PaddingMode)"/>.
/// </summary>
/// <param name="data">The encrypted byte array to decrypt.</param>
/// <param name="password">The password used for decryption, matching the encryption password.</param>
/// <param name="paddingMode">The padding mode used during encryption.</param>
/// <returns>A byte array containing the decrypted data.</returns>
/// <exception cref="ArgumentNullException">
/// Thrown when <paramref name="data"/> is null or empty, or when <paramref name="password"/> is null.
/// </exception>
public static byte[] DecryptData(byte[] data, string password, PaddingMode paddingMode)
{
if (data == null || data.Length == 0)
Expand Down
11 changes: 9 additions & 2 deletions Gandalan.IDAS.Crypto/GDL.IDAS.Crypto.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@
<owners>Gandalan GmbH &amp; Co. KG</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Gandalan.IDAS.Crypto</description>
<copyright>Copyright © Gandalan GmbH &amp; Co. KG 2012-2024</copyright>
<copyright>Copyright © Gandalan GmbH &amp; Co. KG 2012-2025</copyright>
<projectUrl>https://github.com/gandalan/idas-client-libs/</projectUrl>
<license type="expression">MIT</license>
<readme>README.md</readme>
<dependencies>
<dependency id="BCrypt.Net-Next" version="4.0.3" />
<group targetFramework=".NETFramework4.8">
<dependency id="GDL.IDAS.WebApi.Client" version="BUILDVERSION" />
</group>

<group targetFramework="net8.0">
<dependency id="GDL.IDAS.WebApi.Client" version="BUILDVERSION" />
</group>
</dependencies>
</metadata>
<files>
Expand Down
8 changes: 4 additions & 4 deletions Gandalan.IDAS.Crypto/Gandalan.IDAS.Crypto.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Configurations>Debug;Release;Debug - Core only</Configurations>
<DocumentationFile>..\Gandalan.IDAS.Crypto\GDL.IDAS.Crypto.xml</DocumentationFile>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<WarningsAsErrors>$(WarningsAsErrors);NU1605;CA1416</WarningsAsErrors>
<WarningsAsErrors>$(WarningsAsErrors);NU1605;CA1416;</WarningsAsErrors>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug - Core only'">
<WarningsAsErrors>$(WarningsAsErrors);NU1605;CA1416</WarningsAsErrors>
<WarningsAsErrors>$(WarningsAsErrors);NU1605;CA1416;</WarningsAsErrors>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<DocumentationFile>..\Gandalan.IDAS.Crypto\GDL.IDAS.Crypto.xml</DocumentationFile>
<WarningsAsErrors>$(WarningsAsErrors);NU1605;CA1416</WarningsAsErrors>
<WarningsAsErrors>$(WarningsAsErrors);NU1605;CA1416;</WarningsAsErrors>
<NoWarn>CS1572;CS1573;CS1591;</NoWarn>
</PropertyGroup>

Expand Down
27 changes: 27 additions & 0 deletions Gandalan.IDAS.Crypto/HexEncoding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ namespace Gandalan.IDAS.Crypto;
/// </summary>
public class HexEncoding
{
/// <summary>
/// Calculates the number of bytes represented by a hexadecimal string, ignoring non-hexadecimal characters.
/// If the number of valid hexadecimal characters is odd, the last character is discarded.
/// </summary>
/// <param name="hexString">The hexadecimal string to analyze.</param>
/// <returns>
/// The number of bytes represented by the valid hexadecimal characters in the string.
/// Each byte is represented by two hexadecimal characters.
/// </returns>
public static int GetByteCount(string hexString)
{
var numHexChars = 0;
Expand Down Expand Up @@ -75,6 +84,14 @@ public static byte[] GetBytes(string hexString, out int discarded)
return returnValue;
}

/// <summary>
/// Converts a byte array to a hexadecimal string representation, where each byte is represented as two uppercase hexadecimal characters.
/// </summary>
/// <param name="bytes">The byte array to convert.</param>
/// <returns>
/// A string containing the hexadecimal representation of the byte array.
/// Each byte is represented by two characters in uppercase.
/// </returns>
public static string ToString(byte[] bytes)
{
var returnValue = string.Empty;
Expand Down Expand Up @@ -143,6 +160,16 @@ private static byte hexToByte(string hex)
return byte.Parse(hex, NumberStyles.HexNumber);
}

/// <summary>
/// Converts an object to a specified type, returning a default value if the conversion is not possible.
/// </summary>
/// <typeparam name="T">The target type to which the object should be converted.</typeparam>
/// <param name="value">The object to convert.</param>
/// <param name="defaultValue">The default value to return if the conversion is not possible.</param>
/// <returns>
/// The converted value of type <typeparamref name="T"/> if the conversion succeeds;
/// otherwise, <paramref name="defaultValue"/>.
/// </returns>
public static T ConvertTo<T>(object value, T defaultValue)
{
var obj = defaultValue;
Expand Down
3 changes: 3 additions & 0 deletions Gandalan.IDAS.Crypto/SHA1Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

namespace Gandalan.IDAS.Crypto;

/// <summary>
/// Provides helper methods for generating SHA1 hashes.
/// </summary>
public class SHA1Helper
{
/// <summary>
Expand Down
Loading

0 comments on commit 34f1a85

Please sign in to comment.