hash string function

This commit is contained in:
JJJHolscher 2023-10-10 19:10:09 +02:00
parent 607c64351f
commit afe64aaada

8
src/string.py Normal file
View File

@ -0,0 +1,8 @@
#! /usr/bin/env python3
# vim:fenc=utf-8
from hashlib import sha256
def hash_string(string: str) -> str:
return sha256(string.encode('utf-8'),
usedforsecurity=False).hexdigest()