Commit f693411
authored
Refactor ETag to use GZIP CRC32 trailer
Refactor ETag generation to read CRC32 checksum from GZIP file trailer
- Changed _getEtag() signature to accept File handle instead of byte array
- Function now seeks to GZIP trailer and extracts CRC32 checksum
- Added error handling for file operations (seek/read failures)
- Returns boolean to indicate success/failure of ETag generation
- Maintains same hex conversion logic for consistent ETag format
- Simplifies code following DRY principle by eliminating duplicate read file
This refactoring maintains full backward compatibility1 parent 80af245 commit f693411
3 files changed
Lines changed: 40 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 32 | | |
40 | 33 | | |
41 | 34 | | |
42 | | - | |
43 | | - | |
44 | 35 | | |
45 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
46 | 42 | | |
47 | 43 | | |
48 | 44 | | |
| |||
59 | 55 | | |
60 | 56 | | |
61 | 57 | | |
62 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
63 | 62 | | |
64 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | | - | |
67 | | - | |
68 | | - | |
| 67 | + | |
69 | 68 | | |
70 | | - | |
| 69 | + | |
71 | 70 | | |
72 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
73 | 79 | | |
74 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
75 | 91 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 92 | + | |
85 | 93 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
| 278 | + | |
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
711 | 711 | | |
712 | 712 | | |
713 | 713 | | |
714 | | - | |
715 | 714 | | |
716 | 715 | | |
717 | 716 | | |
718 | 717 | | |
719 | | - | |
720 | 718 | | |
721 | | - | |
| 719 | + | |
| 720 | + | |
722 | 721 | | |
723 | 722 | | |
724 | 723 | | |
725 | 724 | | |
726 | 725 | | |
727 | 726 | | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | 727 | | |
733 | 728 | | |
734 | 729 | | |
| |||
739 | 734 | | |
740 | 735 | | |
741 | 736 | | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
742 | 740 | | |
743 | 741 | | |
744 | 742 | | |
| |||
0 commit comments