Package foolscap :: Module banana
[hide private]
[frames] | no frames]

Module banana

source code

Classes [hide private]
  Banana
Functions [hide private]
 
int2b128(integer, stream) source code
 
b1282int(st) source code
 
long_to_bytes(n, blocksize=0)
long_to_bytes(n:long, blocksize:int) : string Convert a long integer to a byte string.
source code
 
bytes_to_long(s)
bytes_to_long(string) : long Convert a byte string to a long integer.
source code
Variables [hide private]
  EPSILON = 0.1
  HIGH_BIT_SET = '\x80'
Function Details [hide private]

long_to_bytes(n, blocksize=0)

source code 

long_to_bytes(n:long, blocksize:int) : string Convert a long integer to a byte string.

If optional blocksize is given and greater than zero, pad the front of the byte string with binary zeros so that the length is a multiple of blocksize.

bytes_to_long(s)

source code 

bytes_to_long(string) : long Convert a byte string to a long integer.

This is (essentially) the inverse of long_to_bytes().