예제 #1
0
 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);
 }
예제 #2
0
 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);
 }