2019年3月

前提是网盘有这个文件,好处在于不用开浏览器...

# -*- coding: utf-8 -*-

import os
import sys
import zlib
import json
import hashlib
import requests
from argparse import ArgumentParser
# 此处的BDUSS是网页源代码中的XDUSS
cookies = {"BDUSS":"pansec_***"}
ua_1 = {
    "X-Requested-With":"XMLHttpRequest",
    "User-Agent":"netdisk;2.0.0.4;PC;PC-Windows;10.0.17763;uploadplugin",
    "Content-Type":"application/x-www-form-urlencoded",
    "Accept":"*/*",
    "Accept-Language":"zh-CN,zh;q=0.8",
    "Accept-Charset":"GBK,utf-8;q=0.7,*;q=0.3",
    }

def crc(path):
    prev = 0
    for line in open(path,"rb"):
        prev = zlib.crc32(line, prev)
    return prev & 0xFFFFFFFF
    
def slice_md5(path):
    with open(path, "rb") as f:
        bin_obj = f.read(256 * 1024)
        part_md5 = hashlib.new('md5', bin_obj).hexdigest()
    return part_md5
    
def info(path):
    crc32 = crc(path)
    part_md5 = slice_md5(path)
    size = fs = os.path.getsize(path)
    f = open(path, "rb")
    hash_obj = hashlib.md5()
    md5_list = []
    while (fs > 0):
        if fs < 4194304:
            bin_obj = f.read(fs)
        else:
            bin_obj = f.read(4194304)
        hash_obj.update(bin_obj)
        md5_list.append(hashlib.new('md5', bin_obj).hexdigest())
        fs -= 4194304
    f.close()
    md5 = hash_obj.hexdigest()
    print("crc32", crc32)
    print("前256K的md5", part_md5)
    print("分片md5", md5_list)
    print("文件md5", md5)
    return crc32, part_md5, md5_list, md5, size
    
def rapidupload(remote_fullpath, md5, part_md5, crc32, size):
    url = "http://pan.baidu.com/api/rapidupload"
    query = {
        "clienttype":"6",
        "version":"2.0.0.4",
        }
    data = {
        "path":remote_fullpath,
        "content-md5":md5,
        "slice-md5":part_md5,#前256K的md5值
        "content-crc32":crc32,#10进制
        "content-length":size,
    }
    # 返回中errno为404说明自己网盘没有这个文件
    rapid_res = requests.post(url, data=data, headers=ua_1, cookies=cookies, params=query)
    rapid_resd = json.loads(rapid_res.content.decode("utf-8"))
    print(rapid_resd)
    if rapid_resd.get("errno") in [-8, 0]:
        if rapid_resd.get("errno") == -8:
            print("已存在同名文件")
        if rapid_resd.get("errno") == 0:
            print(rapid_resd["info"])
        return True
    else:
        print(rapid_resd.get("errno"))
        return False
        
def main():
    # 需要安装argparse
    parser = ArgumentParser(description="尝试秒传文件至百度网盘")
    parser.add_argument("-fp", "--fpath",help="本地文件路径")
    parser.add_argument("-bp", "--bpath",help="网盘路径")
    args = parser.parse_args()
    _, name = os.path.split(args.fpath)
    remote_fullpath = args.bpath + "/" + name
    crc32, part_md5, md5_list, md5, size = info(args.fpath)
    flag = rapidupload(remote_fullpath, md5, part_md5, crc32, size)
    if flag:
        sys.exit("{} 已秒传 位于 {}".format(name, remote_fullpath))
    else:
        sys.exit("{} 秒传失败".format(name))
    
if __name__ == "__main__":
    main()

在控件安装情况下,文件以分片形式上传
请求如下:

POST /rest/2.0/pcs/file?method=upload&app_id=250528&type=tmpfile&dir=%2F/&filename=**X** HTTP/1.1
Cookie: BDUSS=**pansec_X**
Accept: text/*
Content-Type: multipart/form-data; boundary=----------KM7ei4Ef1gL6ae0ei4gL6GI3GI3gL6
User-Agent: netdisk;2.0.0.4;PC;PC-Windows;10.0.17763;uploadplugin
Connection: Keep-Alive
Pragma: no-cache
Host: c.pcs.baidu.com
Cache-Control: no-cache
Content-Length: **X**

------------KM7ei4Ef1gL6ae0ei4gL6GI3GI3gL6
Content-Disposition: form-data; name="Filename"

------------KM7ei4Ef1gL6ae0ei4gL6GI3GI3gL6
Content-Disposition: form-data; name="Filedata"; filename=""
Content-Type: application/octet-stream
**...binary...**

其中**包含起来的地方为个人信息和提交信息,其中:

  • filename为32位大写的字母与数字组合 暂不知产生方法,也许是随机的
  • BDUSS实际上这里和通常使用的值不一样,这个值通过查看网页源代码可以看到,为XDUSS值
  • Content-Length会自动决定
  • 通过multipart/form-data提交的二进制数据分片大小为4M

返回如下:

HTTP/1.1 200 OK
Content-Type: text/html;charset=utf8
Connection: keep-alive
x-bs-client-ip: **X**
x-bs-request-id: **X**
x-bs-file-size: 4194304
Content-MD5: **X**
x-bs-meta-crc32: **X**
x-poms-part-key: **X**
x-bs-version: **X**
Vary: Accept-Encoding
Server: POMS/CloudUI 1.0
Content-Length: **X**

{"md5":"**X**","request_id":**X**}

其中x-bs-client-ip和x-bs-request-id为base64编码,解码后内容形式如下:
*.*.*.* 为你的出口/公网ip
*.*.*.*:*:*:201*-0*-* *:*:* 为内网ip+port+request_id+时间
x-bs-file-size为分片大小,一般是4M
Content-MD5和即为分片的md5,和返回的值一致
x-bs-meta-crc32似乎与我在电脑上计算的CRC32值不一致
x-poms-part-key和x-bs-version一致 32位数字字母小写组合

分片上传返回的md5在全部分片上传结束之后,通过下面这个接口组合成完整的文件

POST /api/create?a=commit&norename&clienttype=6&version=2.0.0.4 HTTP/1.1
Cookie: BDUSS=*
Connection: keep-alive
X-Requested-With: XMLHttpRequest
User-Agent: netdisk;2.0.0.4;PC;PC-Windows;10.0.17763;uploadplugin
Content-Type: application/x-www-form-urlencoded
Accept: */*
Accept-Language: zh-CN,zh;q=0.8
Accept-Charset: GBK,utf-8;q=0.7,*;q=0.3
Host: pan.baidu.com
Cache-Control: no-cache
Content-Length: 266

path=//*&isdir=0&size=13729324&block_list=["","","",""]&method=POST

其中path为网盘路径,根目录则是//+文件名 size是文件总大小,block_list包含一个list,依次是md5值。
最后是浏览器请求了这个,似乎是刷新作用

GET /statistics?clienttype=0&version=v5&op=webupload&type=uploadSuccess&uk=*&product=pan&from=NativeUploader&detailKey=success&filesize=文件大小&is_member=0&success=1&uploadStyle=0&averageSpeed=0&filePath=本地路径&diskPath=/&file={"name":"文件名","type":"文件后缀包括点","server_path":"网盘路径根目录为/","progress":0,"size":"文件大小","path":"本地路径","dir":0,"status":3,"index":2,"resume":true} 
HTTP/1.1
Host: update.pan.baidu.com
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
Accept: image/webp,image/*,*/*;q=0.8
Referer: https://pan.baidu.com/disk/home?
Accept-Encoding: gzip, deflate, sdch, br
Accept-Language: zh-CN,zh;q=0.8
Cookie: *

function session(c) {
    function g(f, e) { 
        f.constructor == String ? f = e && "binary" === e.encoding ? h.uq.Mo(f) : h.bN.Mo(f) : "" ? f = Array.prototype.slice.call(f, 0) : Array.isArray(f) || (f = f.toString());
        e = h.oG(f);
        var l = 8 * f.length;
        f = 1732584193;
        for (var m = -271733879, q = -1732584194, v = 271733878, y = 0; y < e.length; y++)
            e[y] = (e[y] << 8 | e[y] >>> 24) & 16711935 | (e[y] << 24 | e[y] >>> 8) & 4278255360;
        e[l >>> 5] |= 128 << l % 32;
        e[(l + 64 >>> 9 << 4) + 14] = l; 
        for (var l = g.OE, u = g.bF, B = g.cF, A = g.fF, y = 0; y < e.length; y += 16) {
            var z = f,
            C = m,
            n = q,
            t = v;
            f = l(f, m, q, v, e[y + 0], 7, -680876936);
            v = l(v, f, m, q, e[y + 1], 12, -389564586);
            q = l(q, v, f, m, e[y + 2], 17, 606105819);
            m = l(m, q, v, f, e[y + 3], 22, -1044525330);
            f = l(f, m, q, v, e[y + 4], 7, -176418897);
            v = l(v, f, m, q, e[y + 5], 12, 1200080426);
            q = l(q, v, f, m, e[y + 6], 17, -1473231341);
            m = l(m, q, v, f, e[y + 7], 22, -45705983);
            f = l(f, m, q, v, e[y + 8], 7, 1770035416);
            v = l(v, f, m, q, e[y + 9], 12, -1958414417);
            q = l(q, v, f, m, e[y + 10], 17, -42063);
            m = l(m, q, v, f, e[y + 11], 22, -1990404162);
            f = l(f, m, q, v, e[y + 12], 7, 1804603682);
            v = l(v, f, m, q, e[y + 13], 12, -40341101);
            q = l(q, v, f, m, e[y + 14], 17, -1502002290);
            m = l(m, q, v, f, e[y + 15], 22, 1236535329);
            f = u(f, m, q, v, e[y + 1], 5, -165796510);
            v = u(v, f, m, q, e[y + 6], 9, -1069501632);
            q = u(q, v, f, m, e[y + 11], 14, 643717713);
            m = u(m, q, v, f, e[y + 0], 20, -373897302);
            f = u(f, m, q, v, e[y + 5], 5, -701558691);
            v = u(v, f, m, q, e[y + 10], 9, 38016083);
            q = u(q, v, f, m, e[y + 15], 14, -660478335);
            m = u(m, q, v, f, e[y + 4], 20, -405537848);
            f = u(f, m, q, v, e[y + 9], 5, 568446438);
            v = u(v, f, m, q, e[y + 14], 9, -1019803690);
            q = u(q, v, f, m, e[y + 3], 14, -187363961);
            m = u(m, q, v, f, e[y + 8], 20, 1163531501);
            f = u(f, m, q, v, e[y + 13], 5, -1444681467);
            v = u(v, f, m, q, e[y + 2], 9, -51403784);
            q = u(q, v, f, m, e[y + 7], 14, 1735328473);
            m = u(m, q, v, f, e[y + 12], 20, -1926607734);
            f = B(f, m, q, v, e[y + 5], 4, -378558);
            v = B(v, f, m, q, e[y + 8], 11, -2022574463);
            q = B(q, v, f, m, e[y + 11], 16, 1839030562);
            m = B(m, q, v, f, e[y + 14], 23, -35309556);
            f = B(f, m, q, v, e[y + 1], 4, -1530992060);
            v = B(v, f, m, q, e[y + 4], 11, 1272893353);
            q = B(q, v, f, m, e[y + 7], 16, -155497632);
            m = B(m, q, v, f, e[y + 10], 23, -1094730640);
            f = B(f, m, q, v, e[y + 13], 4, 681279174);
            v = B(v, f, m, q, e[y + 0], 11, -358537222);
            q = B(q, v, f, m, e[y + 3], 16, -722521979);
            m = B(m, q, v, f, e[y + 6], 23, 76029189);
            f = B(f, m, q, v, e[y + 9], 4, -640364487);
            v = B(v, f, m, q, e[y + 12], 11, -421815835);
            q = B(q, v, f, m, e[y + 15], 16, 530742520);
            m = B(m, q, v, f, e[y + 2], 23, -995338651);
            f = A(f, m, q, v, e[y + 0], 6, -198630844);
            v = A(v, f, m, q, e[y + 7], 10, 1126891415);
            q = A(q, v, f, m, e[y + 14], 15, -1416354905);
            m = A(m, q, v, f, e[y + 5], 21, -57434055);
            f = A(f, m, q, v, e[y + 12], 6, 1700485571);
            v = A(v, f, m, q, e[y + 3], 10, -1894986606);
            q = A(q, v, f, m, e[y + 10], 15, -1051523);
            m = A(m, q, v, f, e[y + 1], 21, -2054922799);
            f = A(f, m, q, v, e[y + 8], 6, 1873313359);
            v = A(v, f, m, q, e[y + 15], 10, -30611744);
            q = A(q, v, f, m, e[y + 6], 15, -1560198380);
            m = A(m, q, v, f, e[y + 13], 21, 1309151649);
            f = A(f, m, q, v, e[y + 4], 6, -145523070);
            v = A(v, f, m, q, e[y + 11], 10, -1120210379);
            q = A(q, v, f, m, e[y + 2], 15, 718787259);
            m = A(m, q, v, f, e[y + 9], 21, -343485551);
            f = f + z >>> 0;
            m = m + C >>> 0;
            q = q + n >>> 0;
            v = v + t >>> 0
        }
        return h.Wx([f, m, q, v])
    }
    var h = {
        oG: function (e) {
            for (var g = [], h = 0, d = 0; h < e.length; h++,
                d += 8)
                g[d >>> 5] |= e[h] << 24 - d % 32;
            return g
        },
        zN: function (e) {
            for (var g = [], h = 0; h < 32 * e.length; h += 8)
                g.push(e[h >>> 5] >>> 24 - h % 32 & 255);
            return g
        },
        nG: function (e) {
            for (var g = [], h = 0; h < e.length; h++)
                g.push((e[h] >>> 4).toString(16)),
                g.push((e[h] & 15).toString(16));
            return g.join("")
        },
        Wx: function (e) {
            if (e.constructor == Number)
                return h.vA(e, 8) & 16711935 | h.vA(e, 24) & 4278255360;
            for (var g = 0; g < e.length; g++)
                e[g] = h.Wx(e[g]);
            return e
        },
        vA: function (e, g) {
            return e << g | e >>> 32 - g
        },
        bN: {
            Mo: function (e) {
                return h.uq.Mo(unescape(encodeURIComponent(e)))
            },
            yq: function (e) {
                return decodeURIComponent(escape(h.uq.yq(e)))
            }
        },
        uq: {
            Mo: function (e) {
                for (var g = [], h = 0; h < e.length; h++)
                    g.push(e.charCodeAt(h) & 255);
                return g
            },
            yq: function (e) {
                for (var g = [], h = 0; h < e.length; h++)
                    g.push(String.fromCharCode(e[h]));
                return g.join("")
            }
        }
    };
    g.OE = function (b, c, d, e, q, h, g) {
        b = b + (c & d | ~c & e) + (q >>> 0) + g;
        return (b << h | b >>> 32 - h) + c
    };
    g.bF = function (b, c, d, e, q, h, g) {
        b = b + (c & e | d & ~e) + (q >>> 0) + g;
        return (b << h | b >>> 32 - h) + c
    };
    g.cF = function (b, c, d, e, q, h, g) {
        b = b + (c ^ d ^ e) + (q >>> 0) + g;
        return (b << h | b >>> 32 - h) + c
    };
    g.fF = function (b, c, d, e, q, h, g) {
        b = b + (d ^ (c | ~e)) + (q >>> 0) + g;
        return (b << h | b >>> 32 - h) + c
    };
    var d;
    g.PO = 16;
    g.QO = 16;
    c = h.zN(g(c, d)); 
    session = h.nG(c); 
    return session
}

调用方法

buvid3 = "";
c = String(buvid3 || Math.floor(1E5 * Math.random()).toString(16)) + +new Date
console.log(session(c))

其中buvid3为cookie中的值,不登录则为空

v=20190311 这个版本运行结果是一样的,代码的命名?稍微有一点变化

function session(c) {
    function g(t, n, g) {
        var d = g.ff, f = g.gg, c = g.hh, h = g.ii;
        t.constructor == String ? t = n && "binary" === n.encoding ? v.bin.stringToBytes(t) : v.utf8.stringToBytes(t) : v.gettype(t) ? t = Array.prototype.slice.call(t, 0) : Array.isArray(t) || (t = t.toString());
        for (var r = v.bytesToWords(t), i = 8 * t.length, a = 1732584193, o = -271733879, s = -1732584194, u = 271733878, l = 0; l < r.length; l++)
            r[l] = 16711935 & (r[l] << 8 | r[l] >>> 24) | 4278255360 & (r[l] << 24 | r[l] >>> 8);
        r[i >>> 5] |= 128 << i % 32;
        r[14 + (i + 64 >>> 9 << 4)] = i;
        for (l = 0; l < r.length; l += 16) {
            var p = a,
            g = o,
            m = s,
            _ = u;
            a = d(a, o, s, u, r[l + 0], 7, -680876936),
            u = d(u, a, o, s, r[l + 1], 12, -389564586),
            s = d(s, u, a, o, r[l + 2], 17, 606105819),
            o = d(o, s, u, a, r[l + 3], 22, -1044525330),
            a = d(a, o, s, u, r[l + 4], 7, -176418897),
            u = d(u, a, o, s, r[l + 5], 12, 1200080426),
            s = d(s, u, a, o, r[l + 6], 17, -1473231341),
            o = d(o, s, u, a, r[l + 7], 22, -45705983),
            a = d(a, o, s, u, r[l + 8], 7, 1770035416),
            u = d(u, a, o, s, r[l + 9], 12, -1958414417),
            s = d(s, u, a, o, r[l + 10], 17, -42063),
            o = d(o, s, u, a, r[l + 11], 22, -1990404162),
            a = d(a, o, s, u, r[l + 12], 7, 1804603682),
            u = d(u, a, o, s, r[l + 13], 12, -40341101),
            s = d(s, u, a, o, r[l + 14], 17, -1502002290),
            o = d(o, s, u, a, r[l + 15], 22, 1236535329),
            a = f(a, o, s, u, r[l + 1], 5, -165796510),
            u = f(u, a, o, s, r[l + 6], 9, -1069501632),
            s = f(s, u, a, o, r[l + 11], 14, 643717713),
            o = f(o, s, u, a, r[l + 0], 20, -373897302),
            a = f(a, o, s, u, r[l + 5], 5, -701558691),
            u = f(u, a, o, s, r[l + 10], 9, 38016083),
            s = f(s, u, a, o, r[l + 15], 14, -660478335),
            o = f(o, s, u, a, r[l + 4], 20, -405537848),
            a = f(a, o, s, u, r[l + 9], 5, 568446438),
            u = f(u, a, o, s, r[l + 14], 9, -1019803690),
            s = f(s, u, a, o, r[l + 3], 14, -187363961),
            o = f(o, s, u, a, r[l + 8], 20, 1163531501),
            a = f(a, o, s, u, r[l + 13], 5, -1444681467),
            u = f(u, a, o, s, r[l + 2], 9, -51403784),
            s = f(s, u, a, o, r[l + 7], 14, 1735328473),
            o = f(o, s, u, a, r[l + 12], 20, -1926607734),
            a = c(a, o, s, u, r[l + 5], 4, -378558),
            u = c(u, a, o, s, r[l + 8], 11, -2022574463),
            s = c(s, u, a, o, r[l + 11], 16, 1839030562),
            o = c(o, s, u, a, r[l + 14], 23, -35309556),
            a = c(a, o, s, u, r[l + 1], 4, -1530992060),
            u = c(u, a, o, s, r[l + 4], 11, 1272893353),
            s = c(s, u, a, o, r[l + 7], 16, -155497632),
            o = c(o, s, u, a, r[l + 10], 23, -1094730640),
            a = c(a, o, s, u, r[l + 13], 4, 681279174),
            u = c(u, a, o, s, r[l + 0], 11, -358537222),
            s = c(s, u, a, o, r[l + 3], 16, -722521979),
            o = c(o, s, u, a, r[l + 6], 23, 76029189),
            a = c(a, o, s, u, r[l + 9], 4, -640364487),
            u = c(u, a, o, s, r[l + 12], 11, -421815835),
            s = c(s, u, a, o, r[l + 15], 16, 530742520),
            o = c(o, s, u, a, r[l + 2], 23, -995338651),
            a = h(a, o, s, u, r[l + 0], 6, -198630844),
            u = h(u, a, o, s, r[l + 7], 10, 1126891415),
            s = h(s, u, a, o, r[l + 14], 15, -1416354905),
            o = h(o, s, u, a, r[l + 5], 21, -57434055),
            a = h(a, o, s, u, r[l + 12], 6, 1700485571),
            u = h(u, a, o, s, r[l + 3], 10, -1894986606),
            s = h(s, u, a, o, r[l + 10], 15, -1051523),
            o = h(o, s, u, a, r[l + 1], 21, -2054922799),
            a = h(a, o, s, u, r[l + 8], 6, 1873313359),
            u = h(u, a, o, s, r[l + 15], 10, -30611744),
            s = h(s, u, a, o, r[l + 6], 15, -1560198380),
            o = h(o, s, u, a, r[l + 13], 21, 1309151649),
            a = h(a, o, s, u, r[l + 4], 6, -145523070),
            u = h(u, a, o, s, r[l + 11], 10, -1120210379),
            s = h(s, u, a, o, r[l + 2], 15, 718787259),
            o = h(o, s, u, a, r[l + 9], 21, -343485551),
            a = a + p >>> 0,
            o = o + g >>> 0,
            s = s + m >>> 0,
            u = u + _ >>> 0
        }
        return v.endian([a, o, s, u])
    }
    var a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
    var v = {
        rotl: function (e, t) {
            return e << t | e >>> 32 - t
        },
        rotr: function (e, t) {
            return e << 32 - t | e >>> t
        },
        endian: function (e) {
            if (e.constructor == Number)
                return 16711935 & v.rotl(e, 8) | 4278255360 & v.rotl(e, 24);
            for (var t = 0; t < e.length; t++)
                e[t] = v.endian(e[t]);
            return e
        },
        randomBytes: function (e) {
            for (var t = []; 0 < e; e--)
                t.push(Math.floor(256 * Math.random()));
            return t
        },
        bytesToWords: function (e) {
            for (var t = [], n = 0, r = 0; n < e.length; n++,
                r += 8)
                t[r >>> 5] |= e[n] << 24 - r % 32;
            return t
        },
        wordsToBytes: function (e) {
            for (var t = [], n = 0; n < 32 * e.length; n += 8)
                t.push(e[n >>> 5] >>> 24 - n % 32 & 255);
            return t
        },
        bytesToHex: function (e) {
            for (var t = [], n = 0; n < e.length; n++)
                t.push((e[n] >>> 4).toString(16)),
                t.push((15 & e[n]).toString(16));
            return t.join("")
        },
        hexToBytes: function (e) {
            for (var t = [], n = 0; n < e.length; n += 2)
                t.push(parseInt(e.substr(n, 2), 16));
            return t
        },
        bytesToBase64: function (e) {
            for (var t = [], n = 0; n < e.length; n += 3)
                for (var r = e[n] << 16 | e[n + 1] << 8 | e[n + 2], i = 0; i < 4; i++)
                    8 * n + 6 * i <= 8 * e.length ? t.push(a.charAt(r >>> 6 * (3 - i) & 63)) : t.push("=");
            return t.join("")
        },
        base64ToBytes: function (e) {
            e = e.replace(/[^A-Z0-9+\/]/gi, "");
            for (var t = [], n = 0, r = 0; n < e.length; r = ++n % 4)
                0 != r && t.push((a.indexOf(e.charAt(n - 1)) & Math.pow(2, -2 * r + 8) - 1) << 2 * r | a.indexOf(e.charAt(n)) >>> 6 - 2 * r);
            return t
        },
        gettype: function (e, t) {
            function n(e) {
                return !!e.constructor && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e)
            }
            e.exports = function (e) {
                return null != e && (n(e) || (t = e,
                        "function" == typeof t.readFloatLE && "function" == typeof t.slice && n(t.slice(0, 0))) || !!e._isBuffer);
                var t
            }
        },
        utf8: {
            stringToBytes: function (e) {
                return v.bin.stringToBytes(unescape(encodeURIComponent(e)))
            },
            bytesToString: function (e) {
                return decodeURIComponent(escape(v.bin.bytesToString(e)))
            }
        },
        bin: {
            stringToBytes: function (e) {
                for (var t = [], n = 0; n < e.length; n++)
                    t.push(255 & e.charCodeAt(n));
                return t
            },
            bytesToString: function (e) {
                for (var t = [], n = 0; n < e.length; n++)
                    t.push(String.fromCharCode(e[n]));
                return t.join("")
            }
        }
    };
    g.ff = function (e, t, n, r, i, a, o) {
        var s = e + (t & n | ~t & r) + (i >>> 0) + o;
        return (s << a | s >>> 32 - a) + t
    };
    g.gg = function (e, t, n, r, i, a, o) {
        var s = e + (t & r | n & ~r) + (i >>> 0) + o;
        return (s << a | s >>> 32 - a) + t
    };
    g.hh = function (e, t, n, r, i, a, o) {
        var s = e + (t ^ n ^ r) + (i >>> 0) + o;
        return (s << a | s >>> 32 - a) + t
    };
    g.ii = function (e, t, n, r, i, a, o) {
        var s = e + (n ^ (t | ~r)) + (i >>> 0) + o;
        return (s << a | s >>> 32 - a) + t
    };

    var t, n;
    g._blocksize = 16;
    g._digestsize = 16;
    n = v.wordsToBytes(g(c, t, g));
    return t && t.asBytes ? n : t && t.asString ? v.bin.bytesToString(n) : v.bytesToHex(n)

}
// aa4603710244eb68d20192a82aa89904
c = "7C62EBC1-E843-47C6-9025-CC3665A0A6C1101596infoc1552459932619";
console.log(session(c))