Reply to Re: Strings in Dink
If you don't have an account, just leave the password field blank.
76763 / 26 = 2952 (keep in mind the integer rounding)
76763 - 26 * 2952 = 11 = K
2952 / 26 = 113
2952 - 26 * 113 = 14 = N
113 / 26 = 4
113 - 26 * 4 = 9 = I
4 / 26 = 0 (this is how you know when to stop)
4 - 26 * 0 = 4 = D
If you know about different numeric systems (I suppose you're familiar with binary, but hexadecimal may work better to see how it works), the letters A-Z represent the "digits" "1" to "26" (but because of an admittedly sucky choice I made, '26' shows up as '0'. More about that later.). Said "big number" is the just the decimal representation of the twentysiximal (couldn't think of the correct fancy word there) number.
The sucky choice was to let "A" be "1". This causes "Z" to be "26", but since we're counting base 26, "Z" will show up in the decoding algorithm as "0". Protip: let "A" be "0", and then the whole alphabet will be in order.
If you want to add support for lowercase letters, and possibly numbers and whatnot, you should change the "26" to the amount of characters you want to use. Beware of the integer limit.
Last but not least, notice that the letters were retrieved in reverse. First the "K", then the "N", then the "I", and finally the "D". This is not really troublesome, but it's something to be aware of.
76763 - 26 * 2952 = 11 = K
2952 / 26 = 113
2952 - 26 * 113 = 14 = N
113 / 26 = 4
113 - 26 * 4 = 9 = I
4 / 26 = 0 (this is how you know when to stop)
4 - 26 * 0 = 4 = D
If you know about different numeric systems (I suppose you're familiar with binary, but hexadecimal may work better to see how it works), the letters A-Z represent the "digits" "1" to "26" (but because of an admittedly sucky choice I made, '26' shows up as '0'. More about that later.). Said "big number" is the just the decimal representation of the twentysiximal (couldn't think of the correct fancy word there) number.
The sucky choice was to let "A" be "1". This causes "Z" to be "26", but since we're counting base 26, "Z" will show up in the decoding algorithm as "0". Protip: let "A" be "0", and then the whole alphabet will be in order.
If you want to add support for lowercase letters, and possibly numbers and whatnot, you should change the "26" to the amount of characters you want to use. Beware of the integer limit.
Last but not least, notice that the letters were retrieved in reverse. First the "K", then the "N", then the "I", and finally the "D". This is not really troublesome, but it's something to be aware of.







