xxhash 0.0.8

The xxHash hashing algorithm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![macro_use]

// read an integer, advance the pointer by the appropriate amount,
// decrease some counter and do the endian dance
#[macro_export]
macro_rules! read_ptr(($p:ident, $rem:ident, $size:ty) => ({
    #[allow(unused_assignments)]
    use core::mem;
    let mut dp: *const $size = mem::transmute($p);
    let data: $size = *dp;
    dp = dp.offset(1);
    $rem -= mem::size_of::<$size>();
    $p = mem::transmute(dp);
    data.to_le()
}));