<?php
namespace common\pay\ctype;

class PayUtils
{
    /**
     * @param array $data
     * @return string 
     */
    public static function makeSign($data, $md5Key)
    {
		if(isset($data['sign'])) {
			unset($data['sign']);
		}
        ksort($data);
        $str = '';
        foreach ($data as $key => $value) {
            $str .= "{$key}={$value}&";
        }
        $str =  rtrim($str, '&');
		return Sha1($str . $md5Key);
    }
}