Base62 Decoding Short Codes Discussion
Intresting, I had the same requirement so I created this gem https://github.com/xiaohui-zhangxh/xencoder , it can encode/decode interger to BaseX and prevent it to be decoded without seed
How nice to discover ".reverse.each_char.with_index"... much cleaner than the implementation that I was working on!
Thank you very much for all of your work! You are my teacher!
Also, I think I have a better implementation of the decoding algorithm (since ** is a costly operation):
def self.decode(string)
number = 0
string.each_char.with_index do |char, index|
number = ALPHABET.index(char) + number * BASE
end
number
end
Hi Chris!
What commands are you using to replace words in selection?
Thx in advance!
i use ".reverse.each_char.with_index"...
Hey buddy!
I mean at 00:25 Chris selecting word "encode" and changing it live to "decode" using some sort of selection.
Any idea what hotkeys he use?