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.
Pål Bergström 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.