Hi i've several passwords encoded in by doing this:

hashbytes(‘sha1’,'password')

Using SQL Server 2005, we're planing a migration to MySQL.

There's a hash function equivalent in MySQL or PHP.

Because i personally use a typical SHA1 formula and answers are different the ones i've using SQL Server formula.

MySQL includes a SHA1 function:

mysql> SELECT SHA1('password');
+------------------------------------------+
| SHA1('password')                         |
+------------------------------------------+
| 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 |
+------------------------------------------+

Exactly what does the same SQL Server function produce?

I discovered that php uses ascii encoding, so to be able to obtain the same leads to sql server management studio for instance, make use of a varchar(8000) as @input.