dg-hashing-technique
1.0.1
dotnet add package dg-hashing-technique --version 1.0.1
NuGet\Install-Package dg-hashing-technique -Version 1.0.1
<PackageReference Include="dg-hashing-technique" Version="1.0.1" />
<PackageVersion Include="dg-hashing-technique" Version="1.0.1" />
<PackageReference Include="dg-hashing-technique" />
paket add dg-hashing-technique --version 1.0.1
#r "nuget: dg-hashing-technique, 1.0.1"
#:package dg-hashing-technique@1.0.1
#addin nuget:?package=dg-hashing-technique&version=1.0.1
#tool nuget:?package=dg-hashing-technique&version=1.0.1
Hashing Tool
Overview
Hashing Tool is a .NET library that provides methods to generate MD5 / SHA256 / SHA512 / RSA /Encrypt / Decrypt hash from string, object. It uses the System.Security.Cryptography class to generate the hash.
dotnet add package dg-hashing-technique --version 1.0
Include
using Hashing;
MD5 Usage
// hash Dictionary<string,string> with hash secret key
var hashString = Technique.MD5Hash(keyValuePair, secretKey);
//Hash string with hash secret key
var hashString = Technique.MD5Hash(stringToHash, secretKey);
// Hash string
var hashString = Technique.MD5Hash(stringToHash);
// Hash and verify sign (Dictionary<string,string> with hash secret key)
(bool result, string messaage) = VerifySign(keyValuePair, sign, secretKey);
// Hash and verify sign (hashString with hash secret key)
(bool result, string messaage) = VerifySign(hashString, sign, secretKey);
// Hash and verify sign (hashString)
(bool result, string messaage) = VerifySign(hashString, sign);
SHA256 Usage
// hasing Dictionary<string,string> with hash secret
var hashString = Hash_SHA256(keyValuePair,secretKey);
// hasing string with hash secret
var hashString = Hash_SHA256(stringToHash,secretKey);
// hasing string
var hashString = Hash_SHA256(keyValuePair);
SHA512 Usage
// hasing Dictionary<string,string> with hash secret
var hashString = Hash_SHA512(keyValuePair,secretKey);
// hasing string with hash secret
var hashString = Hash_SHA512(stringToHash,secretKey);
// hasing string
var hashString = Hash_SHA512(keyValuePair);
RSA
// hasing string with private key
var hashString = RSASign(stringToHash,privateKey);
// Verify RSA Sign
bool verifyResult = RSA_Sign_Verify(stringToHash, signString, publicKey);
Encrypt / Decrypt
// Encrypt string with key
var encryptedstring = Encrypt(stringToEncrypt,secretKey);
// Decrypt string with key
bool decrptedString = Decrypt(stringToDecrypt, secretKey);
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
This library is licensed under the MIT License. See the LICENSE file for more details.
Contributions
Contributions to this library are welcome. Please open an issue or submit a pull request with your changes
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.