On this page
hashlib.sha384
Prev: hashlib.sha256 | Up: hashlib | Next: hashlib.sha3_224
Rel: hashlib.blake2b, hashlib.blake2s, hashlib.file_digest, hashlib.md5
Ref: docs.python.org — hashlib.sha384
Tags: #public #python3 #stdlib #hashlib
Import
import hashlib
from hashlib import sha384
Signature & Overview
hashlib.sha384(data=b'', *, usedforsecurity=True, string=None)
Returns a sha384 hash object; optionally initialized with a string
Usage
import hashlib
h = hashlib.sha384(b"hello").hexdigest()
assert len(h) == 96
Gotchas
- Truncated SHA-512 variant (48 bytes / 96 hex chars): Fast on 64-bit hardware and resistant to length-extension attacks.
REPL Inspect
from hashlib import sha384
help(sha384)
Linked from
Related notes
- tuts/python3/stdlib_module/hashlib/sha256 Linked here; links to this page; shared tags: #hashlib, #stdlib
- tuts/python3/stdlib_module/hashlib/sha3_224 Linked here; links to this page; shared tags: #hashlib, #stdlib
- tuts/python3/stdlib_module/hashlib Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/hashlib/blake2b Linked here; shared tags: #hashlib, #stdlib
- tuts/python3/stdlib_module/hashlib/blake2s Linked here; shared tags: #hashlib, #stdlib
- tuts/python3/stdlib_module/hashlib/file_digest Linked here; shared tags: #hashlib, #stdlib
- tuts/python3/stdlib_module/hashlib/md5 Linked here; shared tags: #hashlib, #stdlib
- tuts/python3/stdlib_module/hashlib/new shared tags: #hashlib, #stdlib
- tuts/python3/stdlib_module/hashlib/pbkdf2_hmac shared tags: #hashlib, #stdlib
- tuts/python3/stdlib_module/hashlib/sha1 shared tags: #hashlib, #stdlib