Changeset 4671:21813f03d0cc in roaraudio for libroar/crc.c
- Timestamp:
- 12/20/10 00:23:21 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/crc.c
r4645 r4671 58 58 } 59 59 60 int roar_hash_crc24_init(void * state) { 61 uint32_t * self = state; 62 63 *self = roar_crc24_init(); 64 65 return 0; 66 } 67 68 int roar_hash_crc24_digest(void * state, void * digest, size_t * len) { 69 uint32_t * self = state; 70 unsigned char * out = digest; 71 register uint32_t crc; 72 73 if ( *len < 3 ) 74 return -1; 75 76 *len = 3; 77 78 crc = *self; 79 80 out[0] = ((crc & 0x00FF0000) >> 16) & 0xFF; 81 out[1] = ((crc & 0x0000FF00) >> 8) & 0xFF; 82 out[2] = ((crc & 0x000000FF) >> 0) & 0xFF; 83 84 return 0; 85 } 86 87 int roar_hash_crc24_proc(void * state, const void * data, size_t len) { 88 uint32_t * self = state; 89 90 *self = roar_crc24_add(*self, data, len); 91 92 return 0; 93 } 94 60 95 //ll
Note: See TracChangeset
for help on using the changeset viewer.