public void ToHexTest() { var bytes = Enumerable.Range(0, ReadOnlyFixedBytes.MaxLength).Select(i => (byte)i).ToArray(); var fixedBytes = new ReadOnlyFixedBytes(bytes); var string1 = fixedBytes.ToHex(); var sb = new StringBuilder(); fixedBytes.ToHex(sb, 0, fixedBytes.Length); var string2 = sb.ToString(); Assert.Equal(string1, string2); }
/// <summary> /// Give the bytes as a hex string. /// </summary> public string ToHex() { Contract.Requires(Length > 0); return(_bytes.ToHex(_length)); }