Skip to content

Commit 1963523

Browse files
authored
Merge pull request #1195 from stonebig/master
move from sha3 to blake2b like pypi
2 parents 0bb0d61 + b89f5d6 commit 1963523

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

hash.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ def give_hash(file_in, with_this):
1515
with io.open(file_in, 'rb') as f:
1616
return with_this(f.read()).hexdigest()
1717

18+
def give_hashblake(file_in, with_this):
19+
with io.open(file_in, 'rb') as f:
20+
return with_this(f.read(),digest_size=32).hexdigest()
21+
1822

1923
if __name__ == '__main__':
2024
if len(sys.argv) < 2:
@@ -37,8 +41,10 @@ def give_hash(file_in, with_this):
3741
+ " " * (33 - 5)
3842
+ "| Size"
3943
+ " " * (20 - 6)
40-
+ " | SHA3-256"
41-
+ " " * (64 - 7)
44+
#+ " | SHA3-256"
45+
#+ " " * (64 - 8)
46+
+ " | blake2b-256"
47+
+ " " * (64 - 11)
4248
)
4349
line = "|".join(
4450
["-" * len(i) for i in header.split("|")]
@@ -52,7 +58,9 @@ def give_hash(file_in, with_this):
5258
f"{give_hash(file, hashlib.sha1)} | " +
5359
f"{give_hash(file, hashlib.sha256)} | " +
5460
f"{os.path.basename(file):33} |"+
55-
f"{os.path.getsize(file):13,}".replace(",", " ") + ' Bytes' + f" | {give_hash(file, hashlib.sha3_256)}")
61+
f"{os.path.getsize(file):13,}".replace(",", " ") + ' Bytes | ' +
62+
# f" | {give_hash(file, hashlib.sha3_256)}"
63+
f"{give_hashblake(file, hashlib.blake2b)}")
5664

5765

5866

hash_launch.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
call C:\WinPython-64bit-3.6.8.0\scripts\env.bat
1+
call C:\WPy64-3890\scripts\env.bat
22

33
cd %~dp0
44

winpython/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
OTHER DEALINGS IN THE SOFTWARE.
2929
"""
3030

31-
__version__ = '6.0.20230204'
31+
__version__ = '6.0.20230212'
3232
__license__ = __doc__
3333
__project_url__ = 'http://winpython.github.io/'

0 commit comments

Comments
 (0)