summary refs log tree commit diff
path: root/synapse/util/hash.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-05-24 15:32:01 -0400
committerGitHub <noreply@github.com>2021-05-24 15:32:01 -0400
commit7adcb20fc02d614b4a2b03b128b279f25633e2bd (patch)
tree00bfca91a453c3611274f28a27d58b979ad9f104 /synapse/util/hash.py
parentFix docker image to not log at `/homeserver.log` (#10045) (diff)
downloadsynapse-7adcb20fc02d614b4a2b03b128b279f25633e2bd.tar.xz
Add missing type hints to synapse.util (#9982)
Diffstat (limited to 'synapse/util/hash.py')
-rw-r--r--synapse/util/hash.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/util/hash.py b/synapse/util/hash.py
index ba676e1762..7625ca8c2c 100644
--- a/synapse/util/hash.py
+++ b/synapse/util/hash.py
@@ -17,15 +17,15 @@ import hashlib
 import unpaddedbase64
 
 
-def sha256_and_url_safe_base64(input_text):
+def sha256_and_url_safe_base64(input_text: str) -> str:
     """SHA256 hash an input string, encode the digest as url-safe base64, and
     return
 
-    :param input_text: string to hash
-    :type input_text: str
+    Args:
+        input_text: string to hash
 
-    :returns a sha256 hashed and url-safe base64 encoded digest
-    :rtype: str
+    returns:
+        A sha256 hashed and url-safe base64 encoded digest
     """
     digest = hashlib.sha256(input_text.encode()).digest()
     return unpaddedbase64.encode_base64(digest, urlsafe=True)