diff options
Diffstat (limited to 'MediaBrowser.Common/Cryptography/PasswordHash.cs')
| -rw-r--r-- | MediaBrowser.Common/Cryptography/PasswordHash.cs | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/MediaBrowser.Common/Cryptography/PasswordHash.cs b/MediaBrowser.Common/Cryptography/PasswordHash.cs index dca31cd92..c1c154b94 100644 --- a/MediaBrowser.Common/Cryptography/PasswordHash.cs +++ b/MediaBrowser.Common/Cryptography/PasswordHash.cs @@ -97,19 +97,12 @@ namespace MediaBrowser.Common.Cryptography } } - byte[] hash; - byte[] salt; // Check if the string also contains a salt - if (splitted.Length - index == 2) - { - salt = FromHexString(splitted[index++]); - hash = FromHexString(splitted[index++]); - } - else - { - salt = Array.Empty<byte>(); - hash = FromHexString(splitted[index++]); - } + byte[] salt = splitted.Length - index == 2 + ? FromHexString(splitted[index++]) + : Array.Empty<byte>(); + + byte[] hash = FromHexString(splitted[index]); return new PasswordHash(id, hash, salt, parameters); } |
