blob: e0561d917fa006ccb817eb85b1d4143e93f24ffa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
/* ISC license. */
#include <skalibs/uint64.h>
#include <skalibs/bytestr.h>
void uint64_unpack (char const *s, uint64 *u)
{
uint64 r = T8((unsigned char)s[7]) ; r <<= 8 ;
r += T8((unsigned char)s[6]) ; r <<= 8 ;
r += T8((unsigned char)s[5]) ; r <<= 8 ;
r += T8((unsigned char)s[4]) ; r <<= 8 ;
r += T8((unsigned char)s[3]) ; r <<= 8 ;
r += T8((unsigned char)s[2]) ; r <<= 8 ;
r += T8((unsigned char)s[1]) ; r <<= 8 ;
r += T8((unsigned char)s[0]) ;
*u = r ;
}
|