Skip to content

Commit

Permalink
Merge pull request #55 from Jack-Edwards/generic-hash-nullability
Browse files Browse the repository at this point in the history
Better nullability support in GenericHash methods
  • Loading branch information
Jack-Edwards authored Jan 22, 2024
2 parents ac37527 + 9609a85 commit 463fe88
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions BlazorSodium/BlazorSodium.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<Version>1.3.1</Version>
<PackageVersion>1.3.1</PackageVersion>
<Version>1.3.2</Version>
<PackageVersion>1.3.2</PackageVersion>
<LangVersion>12</LangVersion>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions BlazorSodium/Sodium/GenericHash.Interop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static partial class GenericHash
/// <returns></returns>
/// <see cref="https://github.com/jedisct1/libsodium.js/blob/master/wrapper/symbols/crypto_generichash.json"/>
[JSImport("sodium.crypto_generichash", "blazorSodium")]
internal static partial byte[] Crypto_GenericHash_Interop([JSMarshalAs<JSType.Number>] long hashLength, byte[] message, byte[] key = null);
internal static partial byte[] Crypto_GenericHash_Interop([JSMarshalAs<JSType.Number>] long hashLength, byte[] message, byte[]? key = null);

/// <summary>
/// Internal method.
Expand All @@ -24,7 +24,7 @@ public static partial class GenericHash
/// <returns></returns>
/// <see cref="https://github.com/jedisct1/libsodium.js/blob/master/wrapper/symbols/crypto_generichash.json"/>
[JSImport("sodium.crypto_generichash", "blazorSodium")]
internal static partial byte[] Crypto_GenericHash_Interop([JSMarshalAs<JSType.Number>] long hashLength, string message, byte[] key = null);
internal static partial byte[] Crypto_GenericHash_Interop([JSMarshalAs<JSType.Number>] long hashLength, string message, byte[]? key = null);

/* Missing from the sodium module
/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions BlazorSodium/Sodium/GenericHash.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static partial class GenericHash
/// <param name="key">Optional.</param>
/// <returns></returns>
/// <see cref="https://github.com/jedisct1/libsodium.js/blob/master/wrapper/symbols/crypto_generichash.json"/>
public static byte[] Crypto_GenericHash(uint hashLength, byte[] message, byte[] key = null)
public static byte[] Crypto_GenericHash(uint hashLength, byte[] message, byte[]? key = null)
=> Crypto_GenericHash_Interop(hashLength, message, key);

/// <summary>
Expand All @@ -25,7 +25,7 @@ public static byte[] Crypto_GenericHash(uint hashLength, byte[] message, byte[]
/// <param name="key">Optional.</param>
/// <returns></returns>
/// <see cref="https://github.com/jedisct1/libsodium.js/blob/master/wrapper/symbols/crypto_generichash.json"/>
public static byte[] Crypto_GenericHash(uint hashLength, string message, byte[] key = null)
public static byte[] Crypto_GenericHash(uint hashLength, string message, byte[]? key = null)
=> Crypto_GenericHash_Interop(hashLength, message, key);

/// <summary>
Expand All @@ -45,7 +45,7 @@ public static byte[] Crypto_GenericHash_Final(StateAddress stateAddress, uint ha
/// <param name="key"></param>
/// <returns></returns>
/// <see cref="https://github.com/jedisct1/libsodium.js/blob/master/wrapper/symbols/crypto_generichash_init.json"/>
public static StateAddress Crypto_GenericHash_Init(uint hashLength, byte[] key = null)
public static StateAddress Crypto_GenericHash_Init(uint hashLength, byte[]? key = null)
{
int stateAddress = Crypto_GenericHash_Init_Interop(key, hashLength);
return new StateAddress(stateAddress);
Expand Down

0 comments on commit 463fe88

Please sign in to comment.