Hacker News new | past | comments | ask | show | jobs | submit login

Finally...

[Do not read further if you want to solve it yourself]

1. The encoded string can be divided into groups of chars, each representing one (decoded) char. These groups occur every 5, 7, 11, and 13 chars. That is, chars 0-4 correspond to group 1, chars 5-11 correspond to group 2, etc. After the first 4 groups, the lengths repeat. Thus group 5 is chars 36-40.

2. As hinted in this thread, the space is of 59 chars, and there's an offset of 32. So, for each char in each group, subtract 32, sum them up, mod by 59. Add 32 to this result, and that's your decoded character ascii code.

Example: "!8F2>" corresponds to [33, 56, 70, 50, 62]. Subtracting 32 from each of those is [1, 24, 38, 18, 30]. The sum of those is 111. 111 % 59 = 52. Adding back the 32 offset, yields ascii code 84, corresponding to "T".




I had most of the pieces to this, but didn't make the leap to the variance in encoding length being a series of primes. Ah well, maybe next time.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: