swh:1:snp:eb70f1f85391e4b077c211bec36af0061c4bf937
Raw File
Tip revision: 61e880d677370705e4db520a36baf2bd9ae4d928 authored by Jenkins for Software Heritage on 17 September 2020, 16:53:57 UTC
Updated debian changelog for version 0.14.3
Tip revision: 61e880d
common.py
# 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"]
back to top