MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / sha256sum

Function sha256sum

src/Crypt/CryptHash.py:20–26  ·  view source on GitHub ↗
(file, blocksize=65536)

Source from the content-addressed store, hash-verified

18
19
20def sha256sum(file, blocksize=65536):
21 if type(file) is str: # Filename specified
22 file = open(file, "rb")
23 hash = hashlib.sha256()
24 for block in iter(lambda: file.read(blocksize), b""):
25 hash.update(block)
26 return hash.hexdigest()
27
28
29def random(length=64, encoding="hex"):

Callers

nothing calls this directly

Calls 3

readMethod · 0.45
updateMethod · 0.45
hexdigestMethod · 0.45

Tested by

no test coverage detected