|
@@ -1,2 +1,26 @@
|
|
|
<?php
|
|
|
|
|
|
+if(!extension_loaded('phpcrypto')) {
|
|
|
+ dl('phpcrypto.so');
|
|
|
+}
|
|
|
+
|
|
|
+$module = 'phpcrypto';
|
|
|
+$functions = get_extension_funcs($module);
|
|
|
+echo "Functions available in the test extension:\n";
|
|
|
+foreach($functions as $func) {
|
|
|
+ echo $func."\n";
|
|
|
+}
|
|
|
+echo "\n";
|
|
|
+
|
|
|
+//国密
|
|
|
+function string2hex($string){
|
|
|
+ $hex = '';
|
|
|
+ for($i = 0;$i < strlen($string); $i++){
|
|
|
+ $ch = dechex(ord($string[$i]));
|
|
|
+ if(strlen($ch)==1){
|
|
|
+ $ch = "0".$ch;
|
|
|
+ }
|
|
|
+ $hex .=$ch;
|
|
|
+ }
|
|
|
+ return $hex;
|
|
|
+}
|