Add clearer exceptions, warnings and docs

This commit is contained in:
Bond_009
2019-10-20 21:12:03 +02:00
parent fdb0c3a1df
commit fef35d0505
10 changed files with 63 additions and 57 deletions

View File

@@ -61,13 +61,13 @@ namespace MediaBrowser.Common.Cryptography
/// <value>Return the hashed password.</value>
public byte[] Hash { get; }
public static PasswordHash Parse(string storageString)
public static PasswordHash Parse(string hashString)
{
string[] splitted = storageString.Split('$');
string[] splitted = hashString.Split('$');
// The string should at least contain the hash function and the hash itself
if (splitted.Length < 3)
{
throw new ArgumentException("String doesn't contain enough segments", nameof(storageString));
throw new ArgumentException("String doesn't contain enough segments", nameof(hashString));
}
// Start at 1, the first index shouldn't contain any data