public ValueKeccak ToStructRef() { ValueKeccak valueKeccak = new ValueKeccak(); Bytes.AsSpan().CopyTo(valueKeccak.BytesAsSpan); return(valueKeccak); }
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 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); }
private Address ComputeAddress() { Span <byte> hash = ValueKeccak.Compute(Bytes).BytesAsSpan; return(new Address(hash.Slice(12).ToArray())); }
public static Address ComputeAddress(Span <byte> publicKeyBytes) { Span <byte> hash = ValueKeccak.Compute(publicKeyBytes).BytesAsSpan; return(new Address(hash.Slice(12).ToArray())); }