C# Class NuGet.Gallery.Staging.Web.Code.CryptographyService

显示文件 Open project: NuGet/Entropy Class Usage Examples

Public Methods

Method Description
GenerateHash ( byte input, string hashAlgorithmId = Constants.Sha512HashAlgorithmId ) : string
GenerateSaltedHash ( string input, string hashAlgorithmId ) : string
GenerateToken ( ) : string
ValidateHash ( string hash, byte input, string hashAlgorithmId = Constants.Sha512HashAlgorithmId ) : bool
ValidateSaltedHash ( string hash, string input, string hashAlgorithmId ) : bool

Private Methods

Method Description
GenerateLegacySaltedHash ( string input, string hashAlgorithmId ) : string
ValidateLegacySaltedHash ( string hash, string input, string hashAlgorithmId ) : bool

Method Details

GenerateHash() public static method

public static GenerateHash ( byte input, string hashAlgorithmId = Constants.Sha512HashAlgorithmId ) : string
input byte
hashAlgorithmId string
return string

GenerateSaltedHash() public static method

public static GenerateSaltedHash ( string input, string hashAlgorithmId ) : string
input string
hashAlgorithmId string
return string

GenerateToken() public static method

public static GenerateToken ( ) : string
return string

ValidateHash() public static method

public static ValidateHash ( string hash, byte input, string hashAlgorithmId = Constants.Sha512HashAlgorithmId ) : bool
hash string
input byte
hashAlgorithmId string
return bool

ValidateSaltedHash() public static method

public static ValidateSaltedHash ( string hash, string input, string hashAlgorithmId ) : bool
hash string
input string
hashAlgorithmId string
return bool