Skip to content

Commit

Permalink
replace md5 with sha224
Browse files Browse the repository at this point in the history
  • Loading branch information
submarcos committed Jan 12, 2024
1 parent 54b9c4f commit a3a79b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions geostore/tiles/helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from hashlib import md5
from hashlib import sha224
from random import uniform

import mercantile
Expand Down Expand Up @@ -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)

Check warning on line 201 in geostore/tiles/helpers.py

View check run for this annotation

Codecov / codecov/patch

geostore/tiles/helpers.py#L201

Added line #L201 was not covered by tests

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()
Expand Down
4 changes: 2 additions & 2 deletions geostore/tiles/mixins.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from hashlib import md5
from hashlib import sha224
from urllib.parse import unquote, urljoin

from django.core.cache import cache
Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit a3a79b4

Please sign in to comment.