starting core implementation in python
This commit is contained in:
parent
9108c6b0dc
commit
99f76f796c
BIN
src/hash/__pycache__/gen.cpython-39.pyc
Normal file
BIN
src/hash/__pycache__/gen.cpython-39.pyc
Normal file
Binary file not shown.
8
src/hash/gen.py
Normal file
8
src/hash/gen.py
Normal file
@ -0,0 +1,8 @@
|
||||
import hashlib
|
||||
|
||||
def generate_file_hash(file_path, hexdigest=True):
|
||||
with open(file_path, "rb") as f:
|
||||
buf = f.read()
|
||||
|
||||
if hexdigest: return hashlib.md5(buf).hexdigest()
|
||||
return hashlib.md5(buf).digest()
|
3
src/masync.py
Executable file
3
src/masync.py
Executable file
@ -0,0 +1,3 @@
|
||||
|
||||
if __name__ == '__main__':
|
||||
print('python masync script: #!/usr/bin/env python ')
|
Loading…
x
Reference in New Issue
Block a user