예제 #1
0
def test_simple_base62():

    string = 'Testing Base62'

    enc = Base62.encode(string)
    dec = Base62.decode(enc)

    assert string == dec
예제 #2
0
def test_large_base62():

    for i in range(1,100000):
        string = str(i)
        enc = Base62.encode(string)
        dec = Base62.decode(enc)

        assert string == dec

    start = 0
    for i in range(1, 1000):
        # a big random number
        rn = start + (i * random.randrange(1000, 99999999))

        string = 'IsRandom:%s' % rn
        enc = Base62.encode(string)
        dec = Base62.decode(enc)

        assert string == dec