blob: 63941f5180b451edc612707e3a52d6a5835cbe26 [file] [log] [blame]
Tianjie Xu65288122017-10-13 15:10:58 -07001#include <stdint.h>
2
3#include "bsdiff/utils.h"
4
5namespace bsdiff {
6
7
8int64_t ParseInt64(const uint8_t* buf) {
9 int64_t result = buf[7] & 0x7F;
10 for (int i = 6; i >= 0; i--) {
11 result <<= 8;
12 result |= buf[i];
13 }
14
15 if (buf[7] & 0x80)
16 result = -result;
17 return result;
18}
19
20} // namespace bsdiff