public static byte[] Hash160(byte[] message) { var hashBuffer = new byte[HashHelpers.Hash160Size]; if (HashHelpers.TryHash160(message, hashBuffer)) { return(hashBuffer); } throw new ArgumentException(nameof(message)); }
public static UInt160 HashScript(byte[] script) { Span <byte> buffer = stackalloc byte[HashHelpers.Hash160Size]; if (HashHelpers.TryHash160(script, buffer)) { return(new UInt160(buffer)); } throw new ArgumentException(nameof(script)); }
private static UInt160 CalculateScriptHash(ImmutableArray <byte> script) { Span <byte> buffer = stackalloc byte[UInt160.Size]; if (HashHelpers.TryHash160(script.AsSpan(), buffer)) { return(new UInt160(buffer)); } throw new Exception(); }