All Projects → upyun → token-examples

upyun / token-examples

Licence: other
Multilingual token generation example

Programming Languages

javascript
184084 projects - #8 most used programming language
java
68154 projects - #9 most used programming language
python
139335 projects - #7 most used programming language
HTML
75241 projects
PHP
23972 projects - #3 most used programming language

UPYUN token 签名生成程序

使用说明

PHP 版

$etime = time() + 600; // 授权 10 分钟后过期
$key = ''; // token 防盗链密钥
$path = ''; // 文件相对路径
$sign = substr(md5($key.'&'.$etime.'&'.$path), 12, 8).$etime;

填写 $key $path 直接运行即可。

Java 版

//Token 密钥
private static String KEY = "";
// 文件 URI,如:/100.jpg
private static String PATH = "";

填写以上信息,即可运行。

JS 版

time = new Date();
etime = parseInt(time.getTime() / 1000) + 600;  // 授权10分钟后过期
key = '';   // token防盗链密钥
path = '';  // 文件相对路径
str = hex_md5(key + '&' + etime + '&' + path);
sign = str.substr(12, 8) + etime;

Python 版

etime = str(int(time.time()) + 600)  # 授权 10 分钟后过期
key = ''                             # token 防盗链密钥
path = ''                            # 文件相对路径
sign = md5(key + '&' + etime + '&' + path)[12:20] + etime

填写 key path 直接运行即可。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].