以PHP为例,提交短信验证码的生成方式:
$time = time();
$password = md5($account.$apikey.$mobile.$content.$time);
例如:
APIID: test
APIKEY:1q784322ba1d9bb88d50cf5cdfd89k7d
手机号:138xxxxxxxx
内容:您的验证码是:2546。请不要把验证码泄露给其他人。
time:1451544941
结果:$password=md5("test1q784322ba1d9bb88d50cf5cdfd89k7d138xxxxxxxx 您的 验证码是:2546。请不要把验证码泄露给其他人。1451544941");
注意:因为短信内容会包含中文,所以字符编码统一为 UTF-8
查询剩余条数的生成方式:
$time = time();
$password = md5($account.$apikey.$time);
例如:
APIID: test
APIKEY:1q784322ba1d9bb88d50cf5cdfd89k7d
手机号:138xxxxxxxx
time:1451544941
结果:$password=md5("test1q784322ba1d9bb88d50cf5cdfd89k7d1451544941");
Unix时间戳参考地址:http://tool.chinaz.com/Tools/unixtime.aspx
在线咨询
150,000家
企业客户
21年
行业经验
2V1
2对1客户支持