Commit ff9b1c3
committed
Simplify sample code for verifying host identify
* Include `using` directives to make it clear that `System.Linq` and `Renci.SshNet` are required
* Remove unnecessary `new byte[]` in `expectedFingerPrint` declaration
* Use [discard](https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/discards) (i.e. `_`) instead unused `sender` argument (C# 7.0)
* Use [Enumerable.SequenceEqual](https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.sequenceequal) instead of manually comparing byte arrays
* `using var client` without braces (C# 8.0 feature)1 parent 592c86c commit ff9b1c3
1 file changed
+10
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 146 | + | |
| 147 | + | |
150 | 148 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
173 | 157 | | |
174 | 158 | | |
175 | 159 | | |
| |||
0 commit comments