芒果电视tk2 php算法

技术文章 无标签 2018-06-21
<?php

$data = array(
    "did"  => 'e0f53854-e2cc-46e4-9853-8c0c4a3bda00',
    "ver"  => "0.3.0001",
    "pno"  => 1000,
    "clit" => time()
    //"clit" => "1528181207"
);

function charAt($str, $index = 0){
    return substr($str, $index, 1);
}

function getTK2($param1){
    $_loc1_ = 0;
    $_loc2_ = 0;

    foreach( $param1 as $_loc3_ => $_loc4_ ){
        $_loc5_[] = $_loc3_ . "=" . $_loc4_;
    }
    $_loc6_ = join("|",$_loc5_);
    $_loc7_ = base64_encode($_loc6_);
    $_loc8_ = str_replace(array("+","/","="),array("_","~","-"),$_loc7_);
    $_loc11 = "";
    foreach( str_split($_loc8_) as $_loc9_ => $_loc10_ ){
        $_loc11 .= charAt($_loc8_,strlen($_loc8_)-$_loc9_-1);
    }
    return $_loc11;
}

print_r( getTK2($data) );

?>

1条评论

    视频解析学习者

    方便加下QQ吗,我芒果tv用您的tk2算法后遇到问题了,能请教些问题吗?

    游客 Windows10 497 天前回复