Class SHA256CacheHash
Creates hashed keys for the given inputs hashing them to string of length ranging from 2 to 64. Hashed keys are the result of the SHA256 computation of the input value for the given length. This ensures low collision rates with a shorter file name.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Web.Caching
Assembly: SixLabors.ImageSharp.Web.dll
Syntax
public sealed class SHA256CacheHash : ICacheHash
Constructors
| Edit this page View SourceSHA256CacheHash(IOptions<ImageSharpMiddlewareOptions>)
Initializes a new instance of the SHA256CacheHash class.
Declaration
public SHA256CacheHash(IOptions<ImageSharpMiddlewareOptions> options)
Parameters
Type | Name | Description |
---|---|---|
IOptions<ImageSharpMiddlewareOptions> | options | The middleware configuration options. |
Methods
| Edit this page View SourceCreate(string, uint)
Returns the hashed file name for the cached image file.
Declaration
public string Create(string value, uint length)
Parameters
Type | Name | Description |
---|---|---|
string | value | The input value to hash. |
uint | length | The length of the returned hash without any extensions. |
Returns
Type | Description |
---|---|
string | The string. |