def ParseFileHash(hash_obj, result):
    """Parses Hash rdfvalue into ExportedFile's fields."""
    if hash_obj.HasField("md5"):
      result.hash_md5 = str(hash_obj.md5)

    if hash_obj.HasField("sha1"):
      result.hash_sha1 = str(hash_obj.sha1)

    if hash_obj.HasField("sha256"):
      result.hash_sha256 = str(hash_obj.sha256)

    if hash_obj.HasField("pecoff_md5"):
      result.pecoff_hash_md5 = str(hash_obj.pecoff_md5)

    if hash_obj.HasField("pecoff_sha1"):
      result.pecoff_hash_sha1 = str(hash_obj.pecoff_sha1)

    if hash_obj.HasField("signed_data"):
      StatEntryToExportedFileConverter.ParseSignedData(hash_obj.signed_data[0],
                                                       result)
def ParseFileHash ( hash_obj , result ) : if hash_obj . HasField ( "md5" ) : result . hash_md5 = str ( hash_obj . md5 ) if hash_obj . HasField ( "sha1" ) : result . hash_sha1 = str ( hash_obj . sha1 ) if hash_obj . HasField ( "sha256" ) : result . hash_sha256 = str ( hash_obj . sha256 ) if hash_obj . HasField ( "pecoff_md5" ) : result . pecoff_hash_md5 = str ( hash_obj . pecoff_md5 ) if hash_obj . HasField ( "pecoff_sha1" ) : result . pecoff_hash_sha1 = str ( hash_obj . pecoff_sha1 ) if hash_obj . HasField ( "signed_data" ) : StatEntryToExportedFileConverter . ParseSignedData ( hash_obj . signed_data [ 0 ] , result )
Parses Hash rdfvalue into ExportedFile's fields.