mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
feat: refactor refresh token handling; update schema and logic for improved security and functionality
This commit is contained in:
@@ -10,7 +10,12 @@ namespace SharpbinV3.Server
|
||||
var random = new Random();
|
||||
return new string([.. Enumerable.Repeat(chars, length).Select(s => s[random.Next(s.Length)])]);
|
||||
}
|
||||
|
||||
public static string ComputeSha256(string input)
|
||||
{
|
||||
var inputBytes = System.Text.Encoding.UTF8.GetBytes(input);
|
||||
var hashBytes = SHA256.HashData(inputBytes);
|
||||
return Convert.ToHexString(hashBytes);
|
||||
}
|
||||
public static string ComputeHmacSha256(string secret, string input)
|
||||
{
|
||||
var secretBytes = System.Text.Encoding.UTF8.GetBytes(secret);
|
||||
|
||||
Reference in New Issue
Block a user