酷酷博客 酷酷博客

芒果电视tk2 php算法

in 技术文章 read (1304) 文章转载请注明来源!
<?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) );

?>
jrotty WeChat Pay

微信打赏

jrotty Alipay

支付宝打赏

文章二维码

扫描二维码,在手机上阅读!

本文基于《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权
文章链接:https://www.pohaier.com/2018/06/21/23.html (转载时请注明本文出处及文章链接)

技术文章
发表新评论
仅有 1 条评论
  1. 视频解析学习者

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

PREVIOUS NEXT
雷姆
拉姆