blob: 3554dccf17a4a478ff333fefd71e143385e17e3c (
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_big (char const *s, uint64_t *u)
{
uint64_t r = T8((unsigned char)s[0]) ; r <<= 8 ;
r += T8((unsigned char)s[1]) ; r <<= 8 ;
r += T8((unsigned char)s[2]) ; r <<= 8 ;
r += T8((unsigned char)s[3]) ; r <<= 8 ;
r += T8((unsigned char)s[4]) ; r <<= 8 ;
r += T8((unsigned char)s[5]) ; r <<= 8 ;
r += T8((unsigned char)s[6]) ; r <<= 8 ;
r += T8((unsigned char)s[7]) ;
*u = r ;
}
|