This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 689
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't expose Ergo Wallet Password through API
- Loading branch information
Oliver Weichhold
committed
Jan 14, 2022
1 parent
f9996e3
commit 44ab4de
Showing
4 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Globalization; | ||
using System.Linq; | ||
|
||
namespace Miningcore.Extensions | ||
{ | ||
public static class DictionaryExtensions | ||
{ | ||
public static void StripValue<T>(this IDictionary<string, T> dict, string key) | ||
{ | ||
if(dict == null) | ||
return; | ||
|
||
key = key.ToLower(CultureInfo.InvariantCulture); | ||
|
||
var keyActual = dict.Keys.FirstOrDefault(x => x.ToLower(CultureInfo.InvariantCulture) == key); | ||
|
||
if(keyActual != null) | ||
{ | ||
var result = dict.Remove(keyActual); | ||
Debug.Assert(result); | ||
} | ||
} | ||
} | ||
} |