SlugHelperTests
This commit is contained in:
parent
ed52e2f789
commit
7a5cb703ec
3 changed files with 29 additions and 2 deletions
|
|
@ -73,9 +73,9 @@ public static class SlugHelper
|
|||
|
||||
private static string GenerateHashSuffix(string text)
|
||||
{
|
||||
using (var sha256 = SHA256.Create())
|
||||
using (var md5 = MD5.Create())
|
||||
{
|
||||
byte[] hash = sha256.ComputeHash(Encoding.UTF8.GetBytes(text));
|
||||
byte[] hash = md5.ComputeHash(Encoding.UTF8.GetBytes(text));
|
||||
|
||||
// Take first 4 bytes (will become ~5-6 base64url chars)
|
||||
string base64Url = WebEncoders.Base64UrlEncode(hash, 0, 4);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue