Skip to content

Commit

Permalink
add murmur32 to crypto lib (#2604)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim8y authored Apr 4, 2022
1 parent a02209a commit be176a5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/neo/SmartContract/Native/CryptoLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ public static byte[] Sha256(byte[] data)
return data.Sha256();
}

/// <summary>
/// Computes the hash value for the specified byte array using the murmur32 algorithm.
/// </summary>
/// <param name="data">The input to compute the hash code for.</param>
/// <param name="seed">The seed of the murmur32 hash function</param>
/// <returns>The computed hash code.</returns>
[ContractMethod(CpuFee = 1 << 13)]
public static byte[] Murmur32(byte[] data, uint seed)
{
using Murmur32 murmur = new(seed);
return murmur.ComputeHash(data);
}

/// <summary>
/// Verifies that a digital signature is appropriate for the provided key and message using the ECDSA algorithm.
/// </summary>
Expand Down

0 comments on commit be176a5

Please sign in to comment.