Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9343879
common.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
496 B
Subscribers
None
common.py
View Options
# Copyright (C) 2015-2020 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.hashutil
import
MultiHash
def
origin_url_to_sha1
(
origin_url
:
str
)
->
bytes
:
"""Convert an origin URL to a sha1. Encodes URL to utf-8."""
return
MultiHash
.
from_data
(
origin_url
.
encode
(
"utf-8"
),
{
"sha1"
})
.
digest
()[
"sha1"
]
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Fri, Jul 4, 1:55 PM (2 d, 12 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3237893
Attached To
rDSTO Storage manager
Event Timeline
Log In to Comment