private byte[] Key(UInt256 hash) { byte[] buffer = new byte[UInt256.Length + 1]; using (MemoryStream ms = new MemoryStream(buffer, true)) using (BinaryWriter writer = new BinaryWriter(ms)) { writer.Write(prefix); hash.Serialize(writer); } return(buffer); }
public static byte[] ToKey(this UInt256 hash) { byte[] buffer = new byte[UInt256.Length + 1]; using (MemoryStream ms = new MemoryStream(buffer, true)) using (BinaryWriter writer = new BinaryWriter(ms)) { writer.Write(Prefix); hash.Serialize(writer); } return(buffer); }