public void BigEndianLong() { var data = KeyUtilities.GetBigEndianBytes(1L); Assert.AreEqual(8, data.Length); foreach (var bte in data.Take(7)) { Assert.AreEqual(0x00, bte); } Assert.AreEqual(0x01, data.Last()); }
/// <remarks> /// This method mainly exists for unit tests. /// The RFC defines a decimal value in the test table that is an /// intermediate step to a final HOTP value /// </remarks> internal long ComputeHotpDecimal(long counter, OtpHashMode mode) { var hashData = KeyUtilities.GetBigEndianBytes(counter); return(this.CalculateOtp(hashData, mode)); }