spdx_tools.spdx3.writer.console.hash_writer
1# SPDX-FileCopyrightText: 2023 spdx contributors 2# 3# SPDX-License-Identifier: Apache-2.0 4from beartype.typing import TextIO 5 6from spdx_tools.spdx3.model import Hash 7from spdx_tools.spdx3.writer.console.console import write_value 8from spdx_tools.spdx3.writer.console.integrity_method_writer import write_integrity_method 9 10 11def write_hash(hash_object: Hash, text_output: TextIO, heading: bool, indent: bool = True): 12 if heading: 13 text_output.write("## Hash\n") 14 write_value("algorithm", hash_object.algorithm, text_output, indent) 15 write_value("hash_value", hash_object.hash_value, text_output, indent) 16 write_integrity_method(hash_object, text_output, indent)
def
write_hash( hash_object: spdx_tools.spdx3.model.hash.Hash, text_output: <class 'TextIO'>, heading: bool, indent: bool = True):
12def write_hash(hash_object: Hash, text_output: TextIO, heading: bool, indent: bool = True): 13 if heading: 14 text_output.write("## Hash\n") 15 write_value("algorithm", hash_object.algorithm, text_output, indent) 16 write_value("hash_value", hash_object.hash_value, text_output, indent) 17 write_integrity_method(hash_object, text_output, indent)