This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* ======Usage===== | |
* | |
* $db = new Database("127.0.0.1","user","pwd","db1"); | |
* $data = $db->selectDb("db2") | |
* ->selectTable("table1") | |
* ->show("column1 as no1") | |
* ->filter("column1 >", 0) | |
* ->filter("column2 LIKE", "%hello%") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function random_key($length) | |
{ | |
$output=''; | |
for ($a = 0; $a < $length; $a++) { | |
$output .= chr(mt_rand(48, 57)); | |
} | |
return $output; | |
} | |
function random_word($length) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function objectToArray( $object ) | |
{ | |
if(!is_object($object) && !is_array($object)) { | |
return $object; | |
} | |
if(is_object($object )) { | |
$object = get_object_vars( $object ); | |
} | |
return array_map( 'objectToArray', $object ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import binascii | |
import hashlib | |
import base64 | |
import pyDes | |
# iv and key is hex string | |
iv = '3132333435363738' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function PaddingPKCS7($data) { | |
$block_size = mcrypt_get_block_size("tripledes", "cbc"); | |
$padding_char = $block_size - (strlen($data) % $block_size); | |
$data .= str_repeat(chr($padding_char),$padding_char); | |
return $data; | |
} | |
function fmt3DESEx($data, $key, $iv) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = "http://localhost:8000/PortalService"; | |
//targetNamespace | |
$uri = "http://localhost/partalService"; | |
$key = "xxx"; | |
$pwd = "xxx"; | |
$options=array( | |
//'soap_version'=>SOAP_1_2, |