Changeset 5c702a8 in mainline for uspace/srv/fs/udf/udf_cksum.c
- Timestamp:
- 2012-08-27T17:21:38Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0d57c3e
- Parents:
- 5d94b16c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/udf/udf_cksum.c
r5d94b16c r5c702a8 73 73 }; 74 74 75 /** Calculate CRC1676 *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 88 75 /** Unicode checksum 89 76 * … … 103 90 104 91 return crc; 105 }106 107 /** EA checksum108 *109 * Calculate a 16-bit checksum of the Implementation Use110 * Extended Attribute header or Application Use Extended Attribute111 * header. The fields AttributeType through ImplementationIdentifier112 * (or ApplicationIdentifier) inclusively represent the113 * 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;125 92 } 126 93
Note:
See TracChangeset
for help on using the changeset viewer.