API Key

what is best method to generate API key. Any suggestions. I have give username and password for current working., but it would be better to implement API key also. Is there any script or something i’m using PHP.

Thanks for tip

I guess an md5 hash value of the username + a salt would do it.

http://php.net/manual/en/function.md5.php