Changeset View
Standalone View
swh/model/hashutil.py
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
import binascii | import binascii | ||||
import functools | import functools | ||||
import hashlib | import hashlib | ||||
from io import BytesIO | from io import BytesIO | ||||
import os | import os | ||||
from typing import Callable, Dict, Optional, Union | from typing import Callable, Dict, Optional, Union | ||||
ALGORITHMS = set(["sha1", "sha256", "sha1_git", "blake2s256", "blake2b512", "md5"]) | ALGORITHMS = set( | ||||
[ | |||||
"sha1", | |||||
"sha256", | |||||
"sha1_git", | |||||
"blake2s256", | |||||
"blake2b512", | |||||
"sha384", | |||||
"sha512", | |||||
anlambert: Awesome, I also need sha512 for some package loader improvements I am working on :-) | |||||
ardumontAuthorUnsubmitted Done Inline Actionscool, i'm wondering whether we want to open the old hashes though. any opinion on your side? ardumont: cool, i'm wondering whether we want to open the old hashes though.
I see here a need for sha384… | |||||
vlorentzUnsubmitted Not Done Inline Actionswhat does "open the old hashes" mean?
Do we actually have sources of SRIs with only sha384 or only sha512? vlorentz: what does "open the old hashes" mean?
> I see here a need for sha384 and sha512 (your need… | |||||
ardumontAuthorUnsubmitted Done Inline Actions
The ones already present in ALGORITHMS prior to this diff.
D8581#223108 shows sha512. @anlambert also mentions the need for sha512. The thing is, in the current implementation i'm forced to open all attributes fields in the (Skipped)Content model now. ardumont: > what does "open the old hashes" mean?
The ones already present in ALGORITHMS prior to this… | |||||
"md5", | |||||
] | |||||
) | |||||
"""Hashing algorithms supported by this module""" | """Hashing algorithms supported by this module""" | ||||
DEFAULT_ALGORITHMS = set(["sha1", "sha256", "sha1_git", "blake2s256"]) | DEFAULT_ALGORITHMS = set(["sha1", "sha256", "sha1_git", "blake2s256"]) | ||||
"""Algorithms computed by default when calling the functions from this module. | """Algorithms computed by default when calling the functions from this module. | ||||
Subset of :const:`ALGORITHMS`. | Subset of :const:`ALGORITHMS`. | ||||
""" | """ | ||||
▲ Show 20 Lines • Show All 282 Lines • Show Last 20 Lines |
Awesome, I also need sha512 for some package loader improvements I am working on :-)