(self, inner_path, pos, piece)
| 340 | return piecemap |
| 341 | |
| 342 | def verifyPiece(self, inner_path, pos, piece): |
| 343 | piecemap = self.getPiecemap(inner_path) |
| 344 | piece_i = int(pos / piecemap["piece_size"]) |
| 345 | if CryptHash.sha512sum(piece, format="digest") != piecemap["sha512_pieces"][piece_i]: |
| 346 | raise VerifyError("Invalid hash") |
| 347 | return True |
| 348 | |
| 349 | def verifyFile(self, inner_path, file, ignore_same=True): |
| 350 | if "|" not in inner_path: |