Skip to content

Commit

Permalink
Merge pull request #600 from rebane2001/patch-1
Browse files Browse the repository at this point in the history
Use urandom for SECRET_SALT
  • Loading branch information
nicholasserra authored Sep 23, 2024
2 parents cc432bf + e4b924a commit 6ea287c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/markdown2.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
from random import randint, random
from typing import Any, Callable, Collection, Dict, List, Literal, Optional, Tuple, Type, TypedDict, Union
from enum import IntEnum, auto
from os import urandom

if sys.version_info[1] < 9:
from typing import Iterable
Expand All @@ -142,7 +143,7 @@
DEFAULT_TAB_WIDTH = 4


SECRET_SALT = bytes(randint(0, 1000000))
SECRET_SALT = urandom(16)
# MD5 function was previously used for this; the "md5" prefix was kept for
# backwards compatibility.
def _hash_text(s: str) -> str:
Expand Down

0 comments on commit 6ea287c

Please sign in to comment.