diff --git a/geostore/tiles/helpers.py b/geostore/tiles/helpers.py index 4ec2828b..c4549afa 100644 --- a/geostore/tiles/helpers.py +++ b/geostore/tiles/helpers.py @@ -1,4 +1,4 @@ -from hashlib import md5 +from hashlib import sha224 from random import uniform import mercantile @@ -200,7 +200,7 @@ def get_tile_cache_key(self, x, y, z): if self.properties_filter is not None: properties_filter_hash = ','.join(self.properties_filter) - return md5( + return sha224( f'tile_cache_{cache_key}_{x}_{y}_{z}' f'_{self.pixel_buffer}_{features_filter_hash}_{properties_filter_hash}' f'_{self.features_limit}'.encode() diff --git a/geostore/tiles/mixins.py b/geostore/tiles/mixins.py index 81126058..e74daf86 100644 --- a/geostore/tiles/mixins.py +++ b/geostore/tiles/mixins.py @@ -1,4 +1,4 @@ -from hashlib import md5 +from hashlib import sha224 from urllib.parse import unquote, urljoin from django.core.cache import cache @@ -54,7 +54,7 @@ def tiles_pattern(self, request, *args, **kwargs): def tilejson(self, request, *args, **kwargs): """ MVT layer tilejson """ last_update = self.get_last_update() - cache_key = md5( + cache_key = sha224( f"tilejson-{self.get_object().name}{'-'.join([g.name for g in self.authenticated_groups])}".encode() ).hexdigest() version = int(last_update.timestamp())