public void Ctor_ByteArrayGiven_HexStringShouldMatchWithVirgilCryptoImpl() { var hash = new VirgilCrypto().ComputeHash(Encoding.UTF8.GetBytes("1234567890"), HashAlgorithm.SHA256); var hex = VirgilByteArrayUtils.BytesToHex(hash); hex.Should().Be(new Fingerprint(hash).ToHEX()); }
public void Ctor_HexStringGiven_ValuesShouldMatchWithVirgilCryptoImpl() { var hash = new VirgilCrypto().ComputeHash(Encoding.UTF8.GetBytes("1234567890"), HashAlgorithm.SHA256); var hex = VirgilByteArrayUtils.BytesToHex(hash); hash.ShouldAllBeEquivalentTo(new Fingerprint(hex).GetValue()); }
/// <summary> /// To the hexadecimal. /// </summary> public string ToHEX() { return(VirgilByteArrayUtils.BytesToHex(this.fingerprint)); }
/// <summary> /// Initializes a new instance of the <see cref="Fingerprint"/> class. /// </summary> public Fingerprint(string fingerprintHex) { this.fingerprint = VirgilByteArrayUtils.HexToBytes(fingerprintHex); }