Esempio n. 1
0
def main():
    obj = {
        'a': list(range(1, 100)),
        1: random.random(),
        (5, 7): {0.1, 0.2, 0.3},
        1.5: frozenset({1, 2, 3}),
        'd':
        (foo_function, foo_function2),  # tuple of functions, getting fun ha?
        'random': random,  # yes the entire module,
    }
    check = Checksum(obj)
    print(
        check.hex()
    )  # this will change between python versions since we're checksumming the random module
Esempio n. 2
0
def main():
    with_versions = Checksum("abc", depends_on=('wheel', 'setuptools'))
    print(with_versions.hex())
Esempio n. 3
0
def test_checksum_add():
    checksum_collection = Checksum(1) + Checksum(2)
    assert checksum_collection.hex(
    ) == 'ff1112e56c5e7ba9ec2ddd13fc983287f720eb103312bf3536480af0f7dfef255a12'
    assert checksum_to_type(
        checksum_collection.checksum_bytes) == ChecksumCollection