Spacewalker is a collection of packages, or "walkers", for searching within
various random or cryptographic numberspaces for occurs of a given string. It
uses the multiprocessing
module to divide the workload across a number of
CPUs, and the modules are written to run as time-efficiently as possible.
Processing speed is of the highest priority, as the unlikelyhood of finding a matching stream of numbers grows arithmetically with the "width" of the string (or the difference between its highest and lowest values) and exponentially with its length. It's very easy to give search strings that are unlikely to be found in the expected lifetime of this universe.
Spacewalker comes with a commandline utility, spacewalker
, for running
walkers. For example:
$ spacewalker -w pyrandom hello
Matching params: {'width': 10, 'base': 101, 'seedvalue': 424660}
Validation: hello
will search inside Python's random
module space for the string "hello", and
report that it was found add the random seed 424660. The lowest-numbered ASCII
character in "hello" is "e" with value 101. This is the "base" parameter. The
highest-numbered ASCII is "l" with value 111, resulting in the "width" of 10.
This stream could be replayed with this program:
from random import seed, randrange
seed(424660)
chars = []
for i in range(5):
chars.append(chr(101 + randrange(10 + 1)))
print ''.join(chars)
The "+1" in the randrange call is because randrange is an open interval on the right and only returns values less than the given argument.
Of course it's Python 3 compatible! This isn't the stone ages.