diff options
| author | Bond_009 <bond.009@outlook.com> | 2019-10-19 00:22:08 +0200 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2019-11-01 17:52:29 +0100 |
| commit | a245f5a0d463e132bcbb3c5871465bdb8bbec0b7 (patch) | |
| tree | 0c948c2838ea856bd596223ef4d286547aaba767 /MediaBrowser.Common/Cryptography/PasswordHash.cs | |
| parent | 89a21c96c05dd89ff2d2bd5926d0f98c6ef0db9b (diff) | |
Rewrite hex encoder/decoder
Diffstat (limited to 'MediaBrowser.Common/Cryptography/PasswordHash.cs')
| -rw-r--r-- | MediaBrowser.Common/Cryptography/PasswordHash.cs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/MediaBrowser.Common/Cryptography/PasswordHash.cs b/MediaBrowser.Common/Cryptography/PasswordHash.cs index dca31cd92..4c6804097 100644 --- a/MediaBrowser.Common/Cryptography/PasswordHash.cs +++ b/MediaBrowser.Common/Cryptography/PasswordHash.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; -using static MediaBrowser.Common.HexHelper; namespace MediaBrowser.Common.Cryptography { @@ -102,13 +101,13 @@ namespace MediaBrowser.Common.Cryptography // Check if the string also contains a salt if (splitted.Length - index == 2) { - salt = FromHexString(splitted[index++]); - hash = FromHexString(splitted[index++]); + salt = Hex.Decode(splitted[index++]); + hash = Hex.Decode(splitted[index++]); } else { salt = Array.Empty<byte>(); - hash = FromHexString(splitted[index++]); + hash = Hex.Decode(splitted[index++]); } return new PasswordHash(id, hash, salt, parameters); @@ -145,11 +144,11 @@ namespace MediaBrowser.Common.Cryptography if (Salt.Length != 0) { str.Append('$') - .Append(ToHexString(Salt)); + .Append(Hex.Encode(Salt, false)); } return str.Append('$') - .Append(ToHexString(Hash)).ToString(); + .Append(Hex.Encode(Hash, false)).ToString(); } } } |
