mirror of
https://github.com/3b1b/manim.git
synced 2025-09-01 00:48:45 +00:00
Make the default size for hash_string an option
This commit is contained in:
parent
34ad61d013
commit
b593cde317
1 changed files with 2 additions and 3 deletions
|
@ -96,7 +96,6 @@ def binary_search(function: Callable[[float], float],
|
|||
return mh
|
||||
|
||||
|
||||
def hash_string(string: str) -> str:
|
||||
# Truncating at 16 bytes for cleanliness
|
||||
def hash_string(string: str, n_bytes=16) -> str:
|
||||
hasher = hashlib.sha256(string.encode())
|
||||
return hasher.hexdigest()[:16]
|
||||
return hasher.hexdigest()[:n_bytes]
|
||||
|
|
Loading…
Add table
Reference in a new issue