How can I add a password in MySQL directly and match the one Rails create? I understand that it uses SHA1 and then HEX, right (require ''digest/sha1''). But when I try that in MySQL the resulted string isn''t the same. This is what I do in MySQL: SELECT SHA1(''password+salt'') The result is process with SELECT HEX(''result'') Btw, should it be the same? Maybe I''m doing it right after all. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pl Bergstrm wrote:> How can I add a password in MySQL directly and match the one Rails > create? I understand that it uses SHA1 and then HEX, right (require > ''digest/sha1''). But when I try that in MySQL the resulted string isn''t > the same. > > This is what I do in MySQL: > > SELECT SHA1(''password+salt'') > > The result is process with SELECT HEX(''result'') > > Btw, should it be the same? Maybe I''m doing it right after all.Anyone? If I just could understand hexdigest() then that would be a great help. I get hex but can''t find anything about -digest. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---