Post
Topic
Board Bitcoin Technical Support
Re: Encrypted wallet.dat, lost password, any solutions?
by
Revalin
on 19/01/2014, 23:50:47 UTC
The problem is that I usually swap one or two vowels by numbers and I can't remember which of them I did.

I'd appreciate a lot if you help me with the function that, giving a word by parameter, it returns a list of all the words with different combinations, where a might be replaced by 4, e by 3, i by 1 and o by 0. I only need that function, the Revalin code is pretty clear.

This might do what you need:

Code:
password_elements = ['p', ['a', '4'], 'ssw', ['o', '0'], 'rd']

def splat(accum, elements)
  if elements.any?
    [elements.first].flatten.each { |elem| splat(accum + elem, elements[1,999]) }
  else
    test accum
  end
end

splat('', password_elements)