Current location - Quotes Website - Signature design - How php realizes sha 1 encryption of java
How php realizes sha 1 encryption of java
Function encryptokey ($ data) (

$ API key = ' testa pikey 1 1 1 ';

$ps 1 = sha 1($apikey。 strtolower($ data));

$ PS 1 = strto upper($ PS 1);

$s 1 = implosion (str_split($ps 1, 2),'-');

$ps2 = md5($s 1。 $ API key);

$ PS2 = strtoupper($ PS2);

$token = implosion (str _ split ($ PS2,2),'-');

Return $ token

}

echo encrypt okey(' test data ');

Running results:

68- 10-98-74-4C-82-74-4B-CC-49-3 1-98-46-02-EE-8E

You can go to the supporters to see the details. These are all sponsors'. Where there is detailed video teaching, the quality is high. I learned it myself.