aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/Cryptography/PasswordHash.cs
diff options
context:
space:
mode:
authordkanada <dkanada@users.noreply.github.com>2019-11-02 04:03:36 +0900
committerGitHub <noreply@github.com>2019-11-02 04:03:36 +0900
commit3bfb36a67d1ace11b73c25699efe3136025cf2ed (patch)
treed3b16b8897929eab3abd8ab2cd8cc8fc1e8c1dad /MediaBrowser.Common/Cryptography/PasswordHash.cs
parent48a99366b6bd0fea13fb40c6c16374052d5adb6d (diff)
parent60cb256835ff7601ee8ad7deefe52c1ef1c3b305 (diff)
Merge pull request #1915 from Bond-009/hex
Rewrite hex encoder/decoder
Diffstat (limited to 'MediaBrowser.Common/Cryptography/PasswordHash.cs')
-rw-r--r--MediaBrowser.Common/Cryptography/PasswordHash.cs11
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();
}
}
}