using System;
using System.Collections.Generic;
+using System.Linq;
using System.Text;
namespace Novacoin
return bytes;
}
+ public static byte[] TrimArray(byte[] bytes)
+ {
+ int trimStart = bytes.Length - 1;
+ while (trimStart >= 0 && bytes[trimStart] == 0)
+ {
+ trimStart--;
+ }
+
+ return bytes.Take(trimStart + 1).ToArray();
+ }
+
+ public static byte[] AppendWithZeros(byte[] bytes, int nTargetLen=32)
+ {
+ var result = new byte[nTargetLen];
+ bytes.CopyTo(result, 0);
+
+ return result;
+ }
+
public static string ToHex(byte[] bytes)
{
var sb = new StringBuilder();