< Summary

Information
Class: Renci.SshNet.HashInfo
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\HashInfo.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 36
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_KeySize()100%1100%
get_HashAlgorithm()100%1100%
.ctor(...)100%1100%

File(s)

\home\appveyor\projects\ssh-net\src\Renci.SshNet\HashInfo.cs

#LineLine coverage
 1using System;
 2using System.Security.Cryptography;
 3using Renci.SshNet.Common;
 4
 5namespace Renci.SshNet
 6{
 7    /// <summary>
 8    /// Holds information about key size and cipher to use.
 9    /// </summary>
 10    public class HashInfo
 11    {
 12        /// <summary>
 13        /// Gets the size of the key.
 14        /// </summary>
 15        /// <value>
 16        /// The size of the key.
 17        /// </value>
 3283218        public int KeySize { get; private set; }
 19
 20        /// <summary>
 21        /// Gets the cipher.
 22        /// </summary>
 3043623        public Func<byte[], HashAlgorithm> HashAlgorithm { get; private set; }
 24
 25        /// <summary>
 26        /// Initializes a new instance of the <see cref="HashInfo"/> class.
 27        /// </summary>
 28        /// <param name="keySize">Size of the key.</param>
 29        /// <param name="hash">The hash algorithm to use for a given key.</param>
 2804030        public HashInfo(int keySize, Func<byte[], HashAlgorithm> hash)
 2804031        {
 2804032            KeySize = keySize;
 3043633            HashAlgorithm = key => hash(key.Take(KeySize / 8));
 2804034        }
 35    }
 36}