i .iptob64() Returns a string that represents a large integer textually in base 64 for convenient transmission over a network connection.
i .iptob64z() Returns a similar representation to iptob64 but ensures that the top bit of the received value is zero.
b64toip( str ) Returns the IPint represented by the base-64 encoded str .
i .iptobytes() Returns an array of bytes representing a large integer. The representation includes both positive and negative numbers.
bytestoip( buf ) The inverse operation of iptobytes .
i .iptobebytes() Returns an array of bytes in big-endian format representing the magnitude of a large integer; used for instance to pass a value to ssl (3). Only non-negative numbers are represented.
bebytestoip( buf ) The inverse operation of iptobebytes .
inttoip( i ) Creates a new large integer from integer i .
i .iptoint() Converts a large integer i to an int ; returns 0 on error.
i .iptostr( base ) Converts a large integer to a string in base base ; returns nil on error. Only the bases 10, 16, 32, and 64 are supported. Anything else defaults to 16.
strtoip( str , base ) Converts a string str representing a number in in base base to a large integer; returns nil on error. Only the bases 10, 16, 32, and 64 are supported.
random( nbits ) Returns a large random number of length at most minbits . The largest number allowed in the current implementation is 2^8192-1 . The seed for the generator is obtained by duelling clocks.
i .copy() Returns a reference to the same value as i .
i .bits() Returns the number of bits of precision of i .
base .expmod( "exp , mod" ) Returns ( base ** exp ") mod " mod.
i1 .add( i2 ) Returns ( i1 + i2 ).
i1 .sub( i2 ) Returns ( i1 - i2 ).
i1 .mul ( i2 ) Returns i1*i2 .
i1 .div ( i2 ) Returns ( i1 / i2, i1 rem i2 ).
i1 .mod ( i2 ) Returns ( i1 mod i2 ).
i1 .eq( i2 ) Returns 1 if i1 and i2 are equal; 0 otherwise.
i1 .cmp( i2 ) Compares two large integers, returning 1 if i1 is larger, -1 if i2 is larger, and 0 if they are equal.
i .shl( n ) Returns i << n
i .shr( n ) Returns i >> n
i1 .and( i2 ) Returns i & n , bitwise AND
i1 .ori( i2 ) Returns i | n , bitwise inclusive-OR (it is ori because plain or is a Limbo keyword)
i .not() Returns ~ i , bitwise ones-complement
i1 .xor( i2 ) Returns i ^ n , bitwise exclusive-OR
/libmp