summaryrefslogtreecommitdiff
path: root/rsa/common.py
blob: d00a44d4e3f81542aa8affa23a47dc0c90cfb94d (plain)
1
2
3
4
5
6
7
8
9
'''Common functionality shared by several modules.'''

import math

def bit_size(number):
    """Returns the number of bits required to hold a specific long number"""

    return int(math.ceil(math.log(number,2)))