File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ async def index():
173173
174174By default the ` default_key_builder ` builtin key builder is used; this creates a
175175cache key from the function module and name, and the positional and keyword
176- arguments converted to their ` repr() ` representations, encoded as a MD5 hash.
176+ arguments converted to their ` repr() ` representations, encoded as a BLAKE2 hash.
177177You can provide your own by passing a key builder in to ` @cache() ` , or to
178178` FastAPICache.init() ` to apply globally.
179179
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ def default_key_builder(
1414 args : Tuple [Any , ...],
1515 kwargs : Dict [str , Any ],
1616) -> str :
17- cache_key = hashlib .md5 ( # noqa: S324
17+ cache_key = hashlib .blake2b (
1818 f"{ func .__module__ } :{ func .__name__ } :{ args } :{ kwargs } " .encode ()
1919 ).hexdigest ()
2020 return f"{ namespace } :{ cache_key } "
You can’t perform that action at this time.
0 commit comments