private static KeccakStructRef InternalCompute(Span <byte> input) { var result = new KeccakStructRef(); KeccakHash.ComputeHashBytesToSpan(input, result.Bytes); return(result); }
private static ValueKeccak InternalCompute(byte[] input) { var result = new ValueKeccak(); byte *ptr = result.Bytes; var output = new Span <byte>(ptr, KeccakHash.HASH_SIZE); KeccakHash.ComputeHashBytesToSpan(input, output); return(result); }
public static KeccakStructRef Compute(string input) { if (string.IsNullOrWhiteSpace(input)) { return(new KeccakStructRef(Keccak.OfAnEmptyString.Bytes)); } var result = new KeccakStructRef(); KeccakHash.ComputeHashBytesToSpan(System.Text.Encoding.UTF8.GetBytes(input), result.Bytes); return(result); }
public static KeccakStructRef Compute(Span <byte> input) { if (input.Length == 0) { return(new KeccakStructRef(Keccak.OfAnEmptyString.Bytes)); } var result = new KeccakStructRef(); KeccakHash.ComputeHashBytesToSpan(input, result.Bytes); return(result); }
public static ValueKeccak Compute(Span <byte> input) { if (input == null || input.Length == 0) { return(OfAnEmptyString); } var result = new ValueKeccak(); byte *ptr = result.Bytes; var output = new Span <byte>(ptr, KeccakHash.HASH_SIZE); KeccakHash.ComputeHashBytesToSpan(input, output); return(result); }
public static ValueKeccak Compute(ReadOnlySpan <byte> input) { if (input.Length == 0) { return(OfAnEmptyString); } ValueKeccak result = new(); byte * ptr = result.Bytes; Span <byte> output = new(ptr, KeccakHash.HASH_SIZE); KeccakHash.ComputeHashBytesToSpan(input, output); return(result); }