Customizing SMF > SMF Coding Discussion

Recreating the password hash in javascript

(1/1)

ninedoors:
I need to be able to create a user password hash in javascript for a mobile app.  I thought I had it by using a javascript sha1 function but it only works some of the time.  I noticed on the login form that SMF uses javascript to create the hash prior to submitting the form.  Can someone point me to the file with this code in it so I can use the relative code in my function.

What I am doing right now is: sha1Fucntion(username.toLowerCase()+password);

Thanks Nick   

Arantor:
Look at the code SMF uses itself, it doesn't use toLowerCase(), but uses its own lowercase function.

emanuele:
script.js, hashLoginPassword function.
The sha1 javascript functions are in sha1.js.

ninedoors:
Thanks found it and got it working.

Navigation

[0] Message Index

Go to full version