public static string Decode(byte[] bytes, int index) { if (bytes != null && index > 0 && (bytes.Length - index) >= 8) { string str = BytesUtils.Bytes2HexString(bytes, index); return(str.Substring(1, 15)); } throw new ArgumentException("invalid bytes length & index!"); }
public static string GetDateStr(byte[] data, int startIndex) { byte[] dateBytes = new byte[6]; Array.Copy(data, startIndex, dateBytes, 0, 6); return("20" + BytesUtils.Bytes2HexString(dateBytes, 0)); }