mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-02-02 11:34:20 +02:00
Use a URL-safe Base64 string (#499)
This commit is contained in:
parent
776dfaa420
commit
c159027dae
@ -38,8 +38,8 @@ namespace ImgProxy.Examples
|
||||
using (var hmac = new HMACSHA256(keybin))
|
||||
{
|
||||
var hash = hmac.ComputeHash(saltBin.Concat(Encoding.UTF8.GetBytes(path)).ToArray());
|
||||
|
||||
return $"/{Convert.ToBase64String(hash).TrimEnd('=')}{path}";
|
||||
var urlSafeBase64 = Convert.ToBase64String(hash).TrimEnd('=').Replace('+', '-').Replace('/', '_');
|
||||
return $"/{urlSafeBase64}{path}";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user