aboutsummaryrefslogtreecommitdiff
path: root/src/lib/intmath/bits.h
blob: c1483a18b8506b5233303751ca6079e4559cbae5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Copyright (c) 2003-2004, Roger Dingledine
 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
 * Copyright (c) 2007-2019, The Tor Project, Inc. */
/* See LICENSE for licensing information */

/**
 * \file bits.h
 *
 * \brief Header for bits.c
 **/

#ifndef TOR_INTMATH_BITS_H
#define TOR_INTMATH_BITS_H

#include "lib/cc/torint.h"
#include "lib/cc/compat_compiler.h"

int tor_log2(uint64_t u64) ATTR_CONST;
uint64_t round_to_power_of_2(uint64_t u64);
int n_bits_set_u8(uint8_t v);

#endif /* !defined(TOR_INTMATH_BITS_H) */