mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 14:44:29 -04:00
add salt kwarg to abid generation funcs
This commit is contained in:
parent
a49739b41c
commit
c68a66f74e
1 changed files with 2 additions and 2 deletions
|
@ -184,7 +184,7 @@ def abid_part_from_rand(rand: Union[str, UUID, None, int]) -> str:
|
||||||
return str(rand)[-ABID_RAND_LEN:].upper()
|
return str(rand)[-ABID_RAND_LEN:].upper()
|
||||||
|
|
||||||
|
|
||||||
def abid_from_values(prefix, ts, uri, subtype, rand) -> ABID:
|
def abid_from_values(prefix, ts, uri, subtype, rand, salt=DEFAULT_ABID_URI_SALT) -> ABID:
|
||||||
"""
|
"""
|
||||||
Return a freshly derived ABID (assembled from attrs defined in ABIDModel.abid_*_src).
|
Return a freshly derived ABID (assembled from attrs defined in ABIDModel.abid_*_src).
|
||||||
"""
|
"""
|
||||||
|
@ -192,7 +192,7 @@ def abid_from_values(prefix, ts, uri, subtype, rand) -> ABID:
|
||||||
abid = ABID(
|
abid = ABID(
|
||||||
prefix=abid_part_from_prefix(prefix),
|
prefix=abid_part_from_prefix(prefix),
|
||||||
ts=abid_part_from_ts(ts),
|
ts=abid_part_from_ts(ts),
|
||||||
uri=abid_part_from_uri(uri),
|
uri=abid_part_from_uri(uri, salt=salt),
|
||||||
subtype=abid_part_from_subtype(subtype),
|
subtype=abid_part_from_subtype(subtype),
|
||||||
rand=abid_part_from_rand(rand),
|
rand=abid_part_from_rand(rand),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue