当前位置 : 主页 > 网络编程 > JavaScript >

微博图片反查上传用户工具

来源:互联网 收集:自由互联 发布时间:2021-06-30
weiboimgquery.js function idx(c) { c = c.charCodeAt(); if (c = 48 c = 57) return c - 48; if (c = 97 c = 122) return c - 97 + 10; return c - 65 + 36;}function getUid(url) { url = url.replace(/\.\w+$/g, ''); var hash = url.match(/[0-9a-zA-Z]{
weiboimgquery.js
function idx(c) {
    c = c.charCodeAt();
    if (c >= 48 && c <= 57) return c - 48;
    if (c >= 97 && c <= 122) return c - 97 + 10;
    return c - 65 + 36;
}

function getUid(url) {
    url = url.replace(/\.\w+$/g, '');
    var hash = url.match(/[0-9a-zA-Z]{32}$/);
    console.log(hash);
    if (hash == null) return '';
    hash = hash[0].slice(0, 8);
    var uid = 0;
    if (hash[0] == '0' && hash[1] == '0') k = 62;
    else k = 16;
    for (i = 0; i < 8; i++) uid = uid * k + idx(hash[i]);
    var url = "https://weibo.com/u/" + uid;
    return '' + url + '';
}

function weiboHack() {
    var url = document.getElementById("picUrl").value;
    document.getElementById("uidUrl").innerHTML = getUid(url);
}
网友评论