Class SHA256CacheHash
- Namespace
- SixLabors.ImageSharp.Web.Caching
- Assembly
- SixLabors.ImageSharp.Web.dll
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.
public sealed class SHA256CacheHash : ICacheHash
- Inheritance
-
SHA256CacheHash
- Implements
- Inherited Members
Constructors
SHA256CacheHash(IOptions<ImageSharpMiddlewareOptions>)
Initializes a new instance of the SHA256CacheHash class.
public SHA256CacheHash(IOptions<ImageSharpMiddlewareOptions> options)
Parameters
optionsIOptions<ImageSharpMiddlewareOptions>The middleware configuration options.
Methods
Create(string, uint)
Returns the hashed file name for the cached image file.
public string Create(string value, uint length)
Parameters
valuestringThe input value to hash.
lengthuintThe length of the returned hash without any extensions.