Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/testing/mozharness/mozharness/mozilla/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  checksums.py   Sprache: Python

 
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import six


def parse_checksums_file(checksums):
    """
    Parses checksums files that the build system generates and uploads:
    https://hg.mozilla.org/mozilla-central/file/default/build/checksums.py
    """
    fileInfo = {}
    for line in checksums.splitlines():
        hash_, type_, size, file_ = line.split(None, 3)
        type_ = six.ensure_str(type_)
        file_ = six.ensure_str(file_)
        size = int(size)
        if size < 0:
            raise ValueError("Found negative value (%d) for size." % size)
        if file_ not in fileInfo:
            fileInfo[file_] = {"hashes": {}}
        # If the file already exists, make sure that the size matches the
        # previous entry.
        elif fileInfo[file_]["size"] != size:
            raise ValueError(
                "Found different sizes for same file %s (%s and %s)"
                % (file_, fileInfo[file_]["size"], size)
            )
        # Same goes for the hash.
        elif (
            type_ in fileInfo[file_]["hashes"]
            and fileInfo[file_]["hashes"][type_] != hash_
        ):
            raise ValueError(
                "Found different %s hashes for same file %s (%s and %s)"
                % (type_, file_, fileInfo[file_]["hashes"][type_], hash_)
            )
        fileInfo[file_]["size"] = size
        fileInfo[file_]["hashes"][type_] = hash_
    return fileInfo

Messung V0.5
C=86 H=89 G=87

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.