# < 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

Method | Branch coverage | Cyclomatic complexity | Line coverage
--- | --- | --- | ---
get_KeySize() | 100% | 1 | 100%
get_HashAlgorithm() | 100% | 1 | 100%
.ctor(...) | 100% | 1 | 100%

# File(s)

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

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System;`
|  | `2` |  | `using System.Security.Cryptography;`
|  | `3` |  | `using Renci.SshNet.Common;`
|  | `4` |  | ``
|  | `5` |  | `namespace 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>`
| 32832 | `18` |  | `public int KeySize { get; private set; }`
|  | `19` |  | ``
|  | `20` |  | `/// <summary>`
|  | `21` |  | `/// Gets the cipher.`
|  | `22` |  | `/// </summary>`
| 30436 | `23` |  | `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>`
| 28040 | `30` |  | `public HashInfo(int keySize, Func<byte[], HashAlgorithm> hash)`
| 28040 | `31` |  | `{`
| 28040 | `32` |  | `KeySize = keySize;`
| 30436 | `33` |  | `HashAlgorithm = key => hash(key.Take(KeySize / 8));`
| 28040 | `34` |  | `}`
|  | `35` |  | `}`
|  | `36` |  | `}`

# Methods/Properties

get_KeySize()
get_HashAlgorithm()
.ctor(System.Int32,System.Func`2<System.Byte[],System.Security.Cryptography.HashAlgorithm>)