Example #1
0
 // This Calculates the transaction hash (which will be used as its Id)
 private string CalculateHash()
 {
     sequence++;
     return(StringUtil.ApplySha256(
                Sender.GetStringFromKey() +
                Recipient.GetStringFromKey() +
                Value.ToString() + sequence.ToString()
                ));
 }
Example #2
0
        public static string CalculateHash(Block block, int nonce)
        {
            var calculatedhash = StringUtil.ApplySha256(
                block.PreviousHash +
                block.Timestamp +
                nonce +
                block.ReceiptPositions
                );

            return(calculatedhash);
        }
Example #3
0
 public string CalculateHash() =>
 StringUtil.ApplySha256(PreviousHash +
                        timeStamp.ToString() +
                        Nonce.ToString() +
                        Data);