BitSharper.Utils.BytesToHexString C# (CSharp) Method

BytesToHexString() public static method

Returns the given byte array hex encoded.
public static BytesToHexString ( byte bytes ) : string
bytes byte
return string
        public static string BytesToHexString(byte[] bytes)
        {
            var buf = new StringBuilder(bytes.Length*2);
            foreach (var b in bytes)
            {
                var s = b.ToString("x");
                if (s.Length < 2)
                    buf.Append('0');
                buf.Append(s);
            }
            return buf.ToString();
        }

Usage Example

Example #1
0
 /// <summary>
 /// Returns a human readable debug string.
 /// </summary>
 public override string ToString()
 {
     if (IsCoinBase)
     {
         return("TxIn: COINBASE");
     }
     return("TxIn from tx " + Outpoint + " (pubkey: " + Utils.BytesToHexString(ScriptSig.PubKey) + ") script:" + ScriptSig);
 }
All Usage Examples Of BitSharper.Utils::BytesToHexString