Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9346062
vault_testing.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
586 B
Subscribers
None
vault_testing.py
View Options
# Copyright (C) 2017 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
from
swh.model
import
hashutil
def
hash_content
(
content
):
"""Hash the content's id (sha1).
Args:
content (bytes): Content to hash
Returns:
The tuple (content, content's id as bytes)
"""
hashes
=
hashutil
.
MultiHash
.
from_data
(
content
,
hash_names
=
[
"sha1"
])
.
digest
()
return
content
,
hashes
[
"sha1"
]
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Fri, Jul 4, 3:42 PM (2 w, 18 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3242194
Attached To
rDVAU Software Heritage Vault
Event Timeline
Log In to Comment