MCPcopy Create free account
hub / github.com/Parchive/par2cmdline / ComputeFileId

Method ComputeFileId

src/descriptionpacket.cpp:68–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void DescriptionPacket::ComputeFileId(void)
69{
70 FILEDESCRIPTIONPACKET *packet = ((FILEDESCRIPTIONPACKET *)packetdata);
71
72 // Compute the fileid from the hash, length, and name fields in the packet.
73
74 MD5Context context;
75 context.Update(&packet->hash16k,
76 sizeof(FILEDESCRIPTIONPACKET)-offsetof(FILEDESCRIPTIONPACKET,hash16k)
77 +strlen((const char*)packet->name));
78 context.Final(packet->fileid);
79}
80
81// Load a description packet from a specified file
82bool DescriptionPacket::Load(DiskFile *diskfile, u64 offset, PACKET_HEADER &header)

Callers 1

OpenMethod · 0.80

Calls 2

UpdateMethod · 0.80
FinalMethod · 0.80

Tested by

no test coverage detected