Functions to deal with hashes (node IDs and keys).
|
|
intify(hstr)
Convert a hash (big-endian) to a long python integer. |
source code
|
|
|
|
stringify(num)
Convert a long python integer to a hash. |
source code
|
|
|
|
distance(a,
b)
Calculate the distance between two hashes expressed as strings. |
source code
|
|
|
|
newID(suffix='')
Get a new pseudorandom globally unique hash string. |
source code
|
|
|
|
newIDInRange(min,
max)
Get a new pseudorandom globally unique hash string in the range. |
source code
|
|
|
|
randRange(min,
max)
Get a new pseudorandom globally unique hash number in the range. |
source code
|
|
|
|
newTID()
Get a new pseudorandom transaction ID number. |
source code
|
|