Project is now named Celeste
This commit is contained in:
parent
87917f9526
commit
269092fb53
45 changed files with 1507 additions and 12 deletions
7
celeste/crypto/hash.py
Normal file
7
celeste/crypto/hash.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import hashlib
|
||||
|
||||
def sha256(data: bytes, as_bytes: bool = False) -> bytes:
|
||||
hasher = hashlib.sha256()
|
||||
hasher.update(data)
|
||||
hash = hasher.digest()
|
||||
return hash if as_bytes else int.from_bytes(hash)
|
||||
Loading…
Add table
Add a link
Reference in a new issue