Changeset ed19497 in mainline for uspace/srv/fs/fat/fat_dentry.c
- Timestamp:
- 2011-06-05T14:26:58Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 34fdb75
- Parents:
- 2df7fdd4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_dentry.c
r2df7fdd4 red19497 240 240 } 241 241 242 /** Compute checksum of Node name. 243 * 244 * Returns an unsigned byte checksum computed on an unsigned byte 245 * array. The array must be 11 bytes long and is assumed to contain 246 * a name stored in the format of a MS-DOS directory entry. 247 * 248 * @param name Node name read from the dentry. 249 * 250 * @return An 8-bit unsigned checksum of the name. 251 */ 252 uint8_t fat_dentry_chksum(uint8_t *name) 253 { 254 uint8_t i, sum=0; 255 for (i=0; i<(FAT_NAME_LEN+FAT_EXT_LEN); i++) { 256 sum = ((sum & 1) ? 0x80 : 0) + (sum >> 1) + name[i]; 257 } 258 return sum; 259 } 260 261 242 262 /** 243 263 * @}
Note:
See TracChangeset
for help on using the changeset viewer.