It sounds like you really want to install Python (which is based on a hash table). Here's a sample:
from random import choice
from string import ascii_uppercase as LETTERS
from string import digits as DIGITS
print LETTERS
print DIGITS
def get_plate():
return choice(LETTERS) + \
choice(LETTERS) + \
choice(LETTERS) + \
choice(DIGITS) + \
choice(DIGITS) + \
choice(DIGITS)
licenses = set()
while len(licenses) < 10000:
licenses.add(get_plate())
from time import time
t1 = time()
for _ in xrange(1000000):
get_plate() in licenses
t2 = time()
print t2 - t1
This creates a set of 10,000 random plates (3 capital letters and 3 digits each), then checks a million random plates to see if they are in this set. Here's the conclusion:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789
5.88199996948
, 6 , , . :
a_plate = get_plate()
t1 = time()
for _ in xrange(1000000):
a_plate in licenses
...
35 . , ; -)