kpdyer / fteproxy

programmable proxy for censorship circumvention
https://fteproxy.org/
Apache License 2.0
149 stars 21 forks source link

Incorrect ranking results for some regexs #61

Closed kpdyer closed 10 years ago

kpdyer commented 10 years ago

In some cases unrank doesn't return the correct string. For example:

>>> import fte.dfa
>>> dfa = fte.dfa.from_regex("^TESTTEST$", 8)
>>> print dfa.unrank(0)
TTTTTTTT
>>> print dfa.unrank(1)
TTTTTTTE

However, it should be the case that we have

>>> import fte.dfa
>>> dfa = fte.dfa.from_regex("^TESTTEST$", 8)
>>> print dfa.unrank(0)
TESTTEST
>>> print dfa.unrank(1)
[exception]