• 实现微信小程序的3rd_session


    function 3rd_session($len) {

    $fp = @fopen('/dev/urandom','rb');

    $result = '';

    if ($fp !== FALSE) {

    $result .= @fread($fp, $len);

    @fclose($fp);

    } else {

    trigger_error('Can not open /dev/urandom.');

    }

    // convert from binary to string

    $result = base64_encode($result);

    // remove none url chars

    $result = strtr($result, '+/', '-_');

    return substr($result, 0, $len);

    }

  • 相关阅读:
    circle
    pq
    graph
    matrix
    计数(count)
    想象一下(imagine)
    出租车(taxi)
    字符串函数 (strfun)
    Sabota?
    3973: seq
  • 原文地址:https://www.cnblogs.com/grimm/p/6878153.html
Copyright © 2020-2023  润新知