I would like to change the logic of the image hashing. Because our width
and height
parameters directly in the url. As I checked the HashingUtils
class it does not look to easy to change without any risk because it can be used any other assemblies and I already found 3 places where it is used in the Sitecore.Kernel assembly. The problem is that the default implementation only deal with querystring parameters.
For example the url should like this:
/images/{22EB368A-4AD3-48C8-B1EB-1BC14DE0F7BF}-200-100.jpg?hash=AE8EB10933E68E98C9C65324F9CDF0FA2D3AEBAA
And I would like to generate the hash from the part of the url. In this case from 200
and 100
.
I already implemented a custom MediaProvider which is resolving the media item by ID, width and height. Actually the resolving done by a composite key [ID]-[width]-[height]
.
HashingUtils::ComputeHash()
method @Dmytro mentions below already includes a salt that is stored in the Sitecore settingSettings.Media.RequestProtection.SharedSecret
, so that should be sufficient, assuming you remembered to change it from its default value.