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
| Improve this Doc 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
| Improve this Doc View SourceCreate(String, UInt32)
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. |
| UInt32 | length | The length of the returned hash without any extensions. |
Returns
| Type | Description |
|---|---|
| String | The String. |