Home | Trees | Indices | Help |
|
---|
|
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
__revision__ =
|
|||
_fastmath = None hash(x) |
|||
sieve =
|
|||
__package__ =
|
|
getRandomNumber(N:int, randfunc:callable):long Return a random N-bit number. If randfunc is omitted, then Random.new().read is used. NOTE: Confusingly, this function does NOT return N random bits; It returns a random N-bit number, i.e. a random number between 2**(N-1) and (2**N)-1. This function is for internal use only and may be renamed or removed in the future. |
getPrime(N:int, randfunc:callable):long Return a random N-bit prime number. If randfunc is omitted, then Random.new().read is used. |
isPrime(N:long, randfunc:callable):bool Return true if N is prime. If randfunc is omitted, then Random.new().read is used. |
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(string) : long Convert a byte string to a long integer. This is (essentially) the inverse of long_to_bytes(). |
|
sieve
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Oct 24 23:42:29 2010 | http://epydoc.sourceforge.net |