Changes in uspace/srv/fs/udf/udf_cksum.c [5c702a8:48e3190] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/udf/udf_cksum.c
r5c702a8 r48e3190 73 73 }; 74 74 75 /** Calculate CRC16 76 * 77 */ 78 uint16_t udf_cksum(uint8_t *buf, size_t len) 79 { 80 uint16_t crc = 0; 81 82 while (len-- > 0) 83 crc = crc_table[(crc >> 8 ^ *buf++) & 0xff] ^ (crc << 8); 84 85 return crc; 86 } 87 75 88 /** Unicode checksum 76 89 * … … 90 103 91 104 return crc; 105 } 106 107 /** EA checksum 108 * 109 * Calculate a 16-bit checksum of the Implementation Use 110 * Extended Attribute header or Application Use Extended Attribute 111 * header. The fields AttributeType through ImplementationIdentifier 112 * (or ApplicationIdentifier) inclusively represent the 113 * data covered by the checksum (48 bytes). 114 * 115 */ 116 uint16_t udf_ea_cksum(uint8_t *data) 117 { 118 uint16_t checksum = 0; 119 size_t count; 120 121 for (count = 0; count < 48; count++) 122 checksum += *data++; 123 124 return checksum; 92 125 } 93 126
Note:
See TracChangeset
for help on using the changeset viewer.