OAuth OK!
This commit is contained in:
18
Yavsc/Helpers/OAuthHelpers.cs
Normal file
18
Yavsc/Helpers/OAuthHelpers.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace Yavsc.Helpers {
|
||||
public class Helper
|
||||
{
|
||||
public static string GetHash(string input)
|
||||
{
|
||||
HashAlgorithm hashAlgorithm = new SHA256CryptoServiceProvider();
|
||||
|
||||
byte[] byteValue = System.Text.Encoding.UTF8.GetBytes(input);
|
||||
|
||||
byte[] byteHash = hashAlgorithm.ComputeHash(byteValue);
|
||||
|
||||
return Convert.ToBase64String(byteHash);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user