文章目录

抱歉,不再提供在线转换服务。

示例链接:

  • http://x.poxiao.me:1234/189224990/3BA3B4EA759CA9043F887B1B29985677DB38AD03/东京暗鸦_2013_HDTV_01.mp4
  • http://x.poxiao.me:1234/115932953/8D0238A835768073BE0DC3BB946E8AD24F89C92A/东京暗鸦_2013_HDTV_02.mp4

使用说明:
并不是任何http链接都可以转换成qvod链接,只有形如http://host[:port]/file_size/http_hash/file_name的链接才能转换。将快播的http链接输入上方的文本区域,每行一条链接,支持批量转换,点击下方的转换按钮即可完成转换。

转换算法:
fly的要求现贴出转换算法的C++实现(含http转qvod和qvod转http),编译器需支持C++11标准才能编译下面的代码。破解此算法花了博主一整天的时间,转载请注明出处

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/*
* http_to_qvod.cpp:
*
* Copyright (C) 2013 limhiaoing <lxrite@gmail.com> All Rights Reserved.
*
*/

#include <iostream>
#include <cstdint>
#include <iomanip>
#include <vector>
#include <tuple>
#include <cassert>

using hash_tuple_t = std::tuple<std::uint32_t, std::uint32_t, std::uint32_t, std::uint32_t, std::uint32_t>;

hash_tuple_t http_hash_to_qvod_hash(hash_tuple_t http_hash_tuple)
{
auto http2qvod = [](std::uint32_t hash, int rol) -> std::uint32_t {
std::uint32_t inter_value = hash ^ 0x694A873C;
inter_value = ((inter_value & 0xff000000) >> 8) | ((inter_value & 0x00ff0000) << 8) | ((inter_value & 0x0000ff00) >> 8) | ((inter_value & 0x000000ff) << 8);
inter_value = (inter_value << rol) | (inter_value >> (32 - rol));
return ((inter_value & 0xff000000) >> 8) | ((inter_value & 0x00ff0000) << 8) | ((inter_value & 0x0000ff00) >> 8) | ((inter_value & 0x000000ff) << 8);
};
std::uint32_t qvod_hash0 = http2qvod(std::get<0>(http_hash_tuple), 1);
std::uint32_t qvod_hash1, qvod_hash2, qvod_hash3, qvod_hash4;
std::uint32_t key = qvod_hash0 & 0x00000F00;
switch(key) {
case 0x00000000:
case 0x00000400:
case 0x00000800:
case 0x00000C00:
qvod_hash1 = http2qvod(std::get<1>(http_hash_tuple), 1);
qvod_hash2 = http2qvod(std::get<2>(http_hash_tuple), 1);
qvod_hash3 = http2qvod(std::get<3>(http_hash_tuple), 1);
qvod_hash4 = http2qvod(std::get<4>(http_hash_tuple), 1);
break;
case 0x00000100:
case 0x00000500:
case 0x00000900:
case 0x00000D00:
qvod_hash1 = http2qvod(std::get<1>(http_hash_tuple), 9);
qvod_hash2 = http2qvod(std::get<2>(http_hash_tuple), 1);
qvod_hash3 = http2qvod(std::get<3>(http_hash_tuple), 9);
qvod_hash4 = http2qvod(std::get<4>(http_hash_tuple), 1);
break;
case 0x00000200:
case 0x00000600:
case 0x00000A00:
case 0x00000E00:
qvod_hash1 = http2qvod(std::get<1>(http_hash_tuple), 9);
qvod_hash2 = http2qvod(std::get<2>(http_hash_tuple), 7);
qvod_hash3 = http2qvod(std::get<3>(http_hash_tuple), 1);
qvod_hash4 = http2qvod(std::get<4>(http_hash_tuple), 9);
break;
default:
qvod_hash1 = http2qvod(std::get<1>(http_hash_tuple), 9);
qvod_hash2 = http2qvod(std::get<2>(http_hash_tuple), 7);
qvod_hash3 = http2qvod(std::get<3>(http_hash_tuple), 8);
qvod_hash4 = http2qvod(std::get<4>(http_hash_tuple), 1);
break;
}
return std::make_tuple(qvod_hash0, qvod_hash1, qvod_hash2, qvod_hash3, qvod_hash4);
}

hash_tuple_t qvod_hash_to_http_hash(hash_tuple_t qvod_hash_tuple)
{
auto qvod2http = [](std::uint32_t hash, int rol) -> std::uint32_t {
std::uint32_t inter_value = ((hash & 0xff000000) >> 8) | ((hash & 0x00ff0000) << 8) | ((hash & 0x0000ff00) >> 8) | ((hash & 0x000000ff) << 8);
inter_value = (inter_value >> rol) | (inter_value << (32 - rol));
inter_value = ((inter_value & 0xff000000) >> 8) | ((inter_value & 0x00ff0000) << 8) | ((inter_value & 0x0000ff00) >> 8) | ((inter_value & 0x000000ff) << 8);
return inter_value ^ 0x694A873C;
};
std::uint32_t qvod_hash0 = std::get<0>(qvod_hash_tuple);
std::uint32_t http_hash0 = qvod2http(qvod_hash0, 1);
std::uint32_t http_hash1, http_hash2, http_hash3, http_hash4;
std::uint32_t key = qvod_hash0 & 0x00000F00;
switch(key) {
case 0x00000000:
case 0x00000400:
case 0x00000800:
case 0x00000C00:
http_hash1 = qvod2http(std::get<1>(qvod_hash_tuple), 1);
http_hash2 = qvod2http(std::get<2>(qvod_hash_tuple), 1);
http_hash3 = qvod2http(std::get<3>(qvod_hash_tuple), 1);
http_hash4 = qvod2http(std::get<4>(qvod_hash_tuple), 1);
break;
case 0x00000100:
case 0x00000500:
case 0x00000900:
case 0x00000D00:
http_hash1 = qvod2http(std::get<1>(qvod_hash_tuple), 9);
http_hash2 = qvod2http(std::get<2>(qvod_hash_tuple), 1);
http_hash3 = qvod2http(std::get<3>(qvod_hash_tuple), 9);
http_hash4 = qvod2http(std::get<4>(qvod_hash_tuple), 1);
break;
case 0x00000200:
case 0x00000600:
case 0x00000A00:
case 0x00000E00:
http_hash1 = qvod2http(std::get<1>(qvod_hash_tuple), 9);
http_hash2 = qvod2http(std::get<2>(qvod_hash_tuple), 7);
http_hash3 = qvod2http(std::get<3>(qvod_hash_tuple), 1);
http_hash4 = qvod2http(std::get<4>(qvod_hash_tuple), 9);
break;
default:
http_hash1 = qvod2http(std::get<1>(qvod_hash_tuple), 9);
http_hash2 = qvod2http(std::get<2>(qvod_hash_tuple), 7);
http_hash3 = qvod2http(std::get<3>(qvod_hash_tuple), 8);
http_hash4 = qvod2http(std::get<4>(qvod_hash_tuple), 1);
break;
}
return std::make_tuple(http_hash0, http_hash1, http_hash2, http_hash3, http_hash4);
}

void print_hash_tuple(hash_tuple_t hash_tuple)
{
std::cout << std::hex << std::setfill('0') << std::uppercase
<< std::setw(8) << std::get<0>(hash_tuple)
<< std::setw(8) << std::get<1>(hash_tuple)
<< std::setw(8) << std::get<2>(hash_tuple)
<< std::setw(8) << std::get<3>(hash_tuple)
<< std::setw(8) << std::get<4>(hash_tuple);
}

void unit_test()
{
std::vector<hash_tuple_t> http_hash_tuple_vector = {
/*D*/ std::make_tuple(0x2695D1A5, 0x443E4066, 0x3A846960, 0xA759C413, 0xA047D585),
/*C*/ std::make_tuple(0xB138491B, 0x7ECBAF71, 0xEDEF1531, 0xC3F097B4, 0x3FF3F3A5),
/*5*/ std::make_tuple(0x65A8A5E4, 0x0DCFE188, 0x86183574, 0xFC37CA8D, 0x033012EF),
/*1*/ std::make_tuple(0xBEEDB7ED, 0x9D0BE6C6, 0x5C06941C, 0xADE919C7, 0xC5F242B7),
/*2*/ std::make_tuple(0xC4021657, 0x5C5C7EBD, 0xC8A29063, 0xFB8E01DF, 0xFCFEFBE5),
/*9*/ std::make_tuple(0xC5AA0BD7, 0x8873FF74, 0xBC3A1FE9, 0x133DF653, 0xAF82D3B5),
/*F*/ std::make_tuple(0xCA9058A7, 0x4D98EA64, 0x584201C5, 0x3DE1C250, 0x7DEE46FA),
/*B*/ std::make_tuple(0x7584CAB2, 0xEB4A84DA, 0x8C308165, 0x48179FC2, 0xE4A244E9),
/*A*/ std::make_tuple(0x900EEA13, 0x690FAD33, 0xC1F14F24, 0xA8438FBD, 0x0B911D87),
/*E*/ std::make_tuple(0x1B01188C, 0x744BF060, 0x4C47C81C, 0xFD089C56, 0x6CCDED2D),
/*0*/ std::make_tuple(0xC0580F22, 0x2C876931, 0xBE5B2FE2, 0x83FFC574, 0xAE52C3E1),
/*3*/ std::make_tuple(0xFFBDFE95, 0xDC086201, 0xC75FBA99, 0x7B58FDAB, 0x753D3E96),
/*4*/ std::make_tuple(0xC8594D03, 0x757C7DB2, 0xC56F30DA, 0x09886D0C, 0xCE0B5457),
/*6*/ std::make_tuple(0x433594F1, 0x5727054F, 0x0D2C67B7, 0x54250B38, 0xA42CB5CF),
/*7*/ std::make_tuple(0xF8DA04C2, 0x66BAE2C0, 0xCADB48CC, 0x08D1F558, 0xB3DBCF79),
/*8*/ std::make_tuple(0xBB5E3BEE, 0xA36A6A56, 0xDEB9EFCA, 0xCF506CBE, 0xFFABE491)
};

for(const auto& http_hash_tuple : http_hash_tuple_vector) {
auto qvod_hash_tuple = http_hash_to_qvod_hash(http_hash_tuple);
auto http_hash_tuple_cvt = qvod_hash_to_http_hash(qvod_hash_tuple);
assert(http_hash_tuple == http_hash_tuple_cvt);
}
}

int main()
{
std::string http_hash_string = "3BA3B4EA759CA9043F887B1B29985677DB38AD03";
assert(http_hash_string.size() == 40);
std::uint32_t http_hash0 = std::stoul(http_hash_string.substr(0, 8), 0, 16);
std::uint32_t http_hash1 = std::stoul(http_hash_string.substr(8, 8), 0, 16);
std::uint32_t http_hash2 = std::stoul(http_hash_string.substr(16, 8), 0, 16);
std::uint32_t http_hash3 = std::stoul(http_hash_string.substr(24, 8), 0, 16);
std::uint32_t http_hash4 = std::stoul(http_hash_string.substr(32, 8), 0, 16);
hash_tuple_t http_hash_tuple = std::make_tuple(http_hash0, http_hash1, http_hash2, http_hash3, http_hash4);
auto qvod_hash_tuple = http_hash_to_qvod_hash(http_hash_tuple);
print_hash_tuple(qvod_hash_tuple); // A5D267AC7038AC5D132B61FE4B40D2D164E5547E
std::cout << std::endl;
}

[2014/03/25更新]尼莫的要求现贴出转换算法的C#实现

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
* HttpToQvod.cs:
*
* Copyright (C) 2014 By limhiaoing <lxrite@gmail.com> All Rights Reserved.
*
*/

using System;

namespace Dawn
{
class HttpToQvod
{
static Tuple<uint, uint, uint, uint, uint> HttpHashToQvodHash(Tuple<uint, uint, uint, uint, uint> httpHashTuple)
{
Func<uint, int, uint> http2qvod = new Func<uint, int, uint>((hash, rol) =>
{
uint interValue = hash ^ 0x694A873C;
interValue = ((interValue & 0xFF000000) >> 8) | ((interValue & 0x00FF0000) << 8) | ((interValue & 0x0000FF00) >> 8) | ((interValue & 0x000000FF) << 8);
interValue = (interValue << rol) | (interValue >> (32 - rol));
return ((interValue & 0xFF000000) >> 8) | ((interValue & 0x00FF0000) << 8) | ((interValue & 0x0000FF00) >> 8) | ((interValue & 0x000000FF) << 8);
});
uint qvodHash1 = http2qvod(httpHashTuple.Item1, 1);
uint qvodHash2, qvodHash3, qvodHash4, qvodHash5;
uint key = qvodHash1 & 0x00000F00;
switch (key)
{
case 0x00000000:
case 0x00000400:
case 0x00000800:
case 0x00000C00:
qvodHash2 = http2qvod(httpHashTuple.Item2, 1);
qvodHash3 = http2qvod(httpHashTuple.Item3, 1);
qvodHash4 = http2qvod(httpHashTuple.Item4, 1);
qvodHash5 = http2qvod(httpHashTuple.Item5, 1);
break;
case 0x00000100:
case 0x00000500:
case 0x00000900:
case 0x00000D00:
qvodHash2 = http2qvod(httpHashTuple.Item2, 9);
qvodHash3 = http2qvod(httpHashTuple.Item3, 1);
qvodHash4 = http2qvod(httpHashTuple.Item4, 9);
qvodHash5 = http2qvod(httpHashTuple.Item5, 1);
break;
case 0x00000200:
case 0x00000600:
case 0x00000A00:
case 0x00000E00:
qvodHash2 = http2qvod(httpHashTuple.Item2, 9);
qvodHash3 = http2qvod(httpHashTuple.Item3, 7);
qvodHash4 = http2qvod(httpHashTuple.Item4, 1);
qvodHash5 = http2qvod(httpHashTuple.Item5, 9);
break;
default:
qvodHash2 = http2qvod(httpHashTuple.Item2, 9);
qvodHash3 = http2qvod(httpHashTuple.Item3, 7);
qvodHash4 = http2qvod(httpHashTuple.Item4, 8);
qvodHash5 = http2qvod(httpHashTuple.Item5, 1);
break;
}
return new Tuple<uint, uint, uint, uint, uint>(qvodHash1, qvodHash2, qvodHash3, qvodHash4, qvodHash5);
}

static Tuple<uint, uint, uint, uint, uint> QvodHashToHttpHash(Tuple<uint, uint, uint, uint, uint> qvodHashTuple)
{
Func<uint, int, uint> qvod2http = new Func<uint, int, uint>((hash, rol) =>
{
uint interValue = ((hash & 0xFF000000) >> 8) | ((hash & 0x00FF0000) << 8) | ((hash & 0x0000FF00) >> 8) | ((hash & 0x000000FF) << 8);
interValue = (interValue >> rol) | (interValue << (32 - rol));
interValue = ((interValue & 0xFF000000) >> 8) | ((interValue & 0x00FF0000) << 8) | ((interValue & 0x0000FF00) >> 8) | ((interValue & 0x000000FF) << 8);
return interValue ^ 0x694A873C;
});
uint qvodHash1 = qvodHashTuple.Item1;
uint httpHash1 = qvod2http(qvodHashTuple.Item1, 1);
uint httpHash2, httpHash3, httpHash4, httpHash5;
uint key = qvodHash1 & 0x00000F00;
switch(key) {
case 0x00000000:
case 0x00000400:
case 0x00000800:
case 0x00000C00:
httpHash2 = qvod2http(qvodHashTuple.Item2, 1);
httpHash3 = qvod2http(qvodHashTuple.Item3, 1);
httpHash4 = qvod2http(qvodHashTuple.Item4, 1);
httpHash5 = qvod2http(qvodHashTuple.Item5, 1);
break;
case 0x00000100:
case 0x00000500:
case 0x00000900:
case 0x00000D00:
httpHash2 = qvod2http(qvodHashTuple.Item2, 9);
httpHash3 = qvod2http(qvodHashTuple.Item3, 1);
httpHash4 = qvod2http(qvodHashTuple.Item4, 9);
httpHash5 = qvod2http(qvodHashTuple.Item5, 1);
break;
case 0x00000200:
case 0x00000600:
case 0x00000A00:
case 0x00000E00:
httpHash2 = qvod2http(qvodHashTuple.Item2, 9);
httpHash3 = qvod2http(qvodHashTuple.Item3, 7);
httpHash4 = qvod2http(qvodHashTuple.Item4, 1);
httpHash5 = qvod2http(qvodHashTuple.Item5, 9);
break;
default:
httpHash2 = qvod2http(qvodHashTuple.Item2, 9);
httpHash3 = qvod2http(qvodHashTuple.Item3, 7);
httpHash4 = qvod2http(qvodHashTuple.Item4, 8);
httpHash5 = qvod2http(qvodHashTuple.Item5, 1);
break;
}
return new Tuple<uint, uint, uint, uint, uint>(httpHash1, httpHash2, httpHash3, httpHash4, httpHash5);
}

static void Main(string[] args)
{
string httpHashString = "3BA3B4EA759CA9043F887B1B29985677DB38AD03";
uint httpHash1 = Convert.ToUInt32(httpHashString.Substring(0, 8), 16);
uint httpHash2 = Convert.ToUInt32(httpHashString.Substring(8, 8), 16);
uint httpHash3 = Convert.ToUInt32(httpHashString.Substring(16, 8), 16);
uint httpHash4 = Convert.ToUInt32(httpHashString.Substring(24, 8), 16);
uint httpHash5 = Convert.ToUInt32(httpHashString.Substring(32, 8), 16);
var httpHashTuple = new Tuple<uint, uint, uint, uint, uint>(httpHash1, httpHash2, httpHash3, httpHash4, httpHash5);
var qvodHashTuple = HttpHashToQvodHash(httpHashTuple);
Console.WriteLine(qvodHashTuple.Item1.ToString("X8")
+ qvodHashTuple.Item2.ToString("X8")
+ qvodHashTuple.Item3.ToString("X8")
+ qvodHashTuple.Item4.ToString("X8")
+ qvodHashTuple.Item5.ToString("X8")); // A5D267AC7038AC5D132B61FE4B40D2D164E5547E
}
}
}

[2014/05/16更新] 尝试使用php实现了这个转换算法(前提是php的integer类型须为有符号的32位整型)。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?php
/*
* http_to_qvod.php:
*
* Copyright (C) 2014 By limhiaoing <lxrite@gmail.com> All Rights Reserved.
*
*/
function hex_string_to_integer($hex_str) {
$hex_str = strtoupper($hex_str);
$first_char = $hex_str[0];
$or_value = -2147483648; // 相当于无符号0x80000000
switch ($first_char) {
case '8':
$hex_str[0] = '0';
break;
case '9':
$hex_str[0] = '1';
break;
case 'A':
$hex_str[0] = '2';
break;
case 'B':
$hex_str[0] = '3';
break;
case 'C':
$hex_str[0] = '4';
break;
case 'D':
$hex_str[0] = '5';
break;
case 'E':
$hex_str[0] = '6';
break;
case 'F':
$hex_str[0] = '7';
break;
default:
$or_value = 0; // 相当于0x00000000
break;
}
$ret_val = intval($hex_str, 16);
return $ret_val | $or_value;
}
function hash_to_hex_string($hash) {
$hex_str = strtoupper(dechex($hash));
$prefix_length = 8 - strlen($hex_str);
for($i = 0; $i < $prefix_length; ++$i) {
$hex_str = '0' . $hex_str;
}
return hex_str;
}
function integer_to_hex_string($val) {
return dechex($val);
}
function int32_shr($val, $bits) {
if($bits <= 0 || $bits >= 32) {
return $val;
}
$and_value = 0x7FFFFFFF;
if($bits > 1) {
$and_value = $and_value >> ($bits - 1);
}
return ($val >> $bits) & $and_value;
}
function http2qvod($hash, $rol) {
$inter_value = $hash ^ 0x694A873C;
$inter_value = int32_shr($inter_value & -16777216, 8) | (($inter_value & 0x00FF0000) << 8) | int32_shr($inter_value & 0x0000FF00, 8) | (($inter_value & 0x000000FF) << 8);
$inter_value = ($inter_value << $rol) | int32_shr($inter_value, (32 - $rol));
return int32_shr($inter_value & -16777216, 8) | (($inter_value & 0x00FF0000) << 8) | int32_shr($inter_value & 0x0000FF00, 8) | (($inter_value & 0x000000FF) << 8);
}
function http_hash_to_qvod_hash($http_hash0, $http_hash1, $http_hash2, $http_hash3, $http_hash4) {
$qvod_hash0 = http2qvod($http_hash0, 1);
$key = $qvod_hash0 & 0x00000F00;
switch($key) {
case 0x00000000:
case 0x00000400:
case 0x00000800:
case 0x00000C00:
$qvod_hash1 = http2qvod($http_hash1, 1);
$qvod_hash2 = http2qvod($http_hash2, 1);
$qvod_hash3 = http2qvod($http_hash3, 1);
$qvod_hash4 = http2qvod($http_hash4, 1);
break;
case 0x00000100:
case 0x00000500:
case 0x00000900:
case 0x00000D00:
$qvod_hash1 = http2qvod($http_hash1, 9);
$qvod_hash2 = http2qvod($http_hash2, 1);
$qvod_hash3 = http2qvod($http_hash3, 9);
$qvod_hash4 = http2qvod($http_hash4, 1);
break;
case 0x00000200:
case 0x00000600:
case 0x00000A00:
case 0x00000E00:
$qvod_hash1 = http2qvod($http_hash1, 9);
$qvod_hash2 = http2qvod($http_hash2, 7);
$qvod_hash3 = http2qvod($http_hash3, 1);
$qvod_hash4 = http2qvod($http_hash4, 9);
break;
default:
$qvod_hash1 = http2qvod($http_hash1, 9);
$qvod_hash2 = http2qvod($http_hash2, 7);
$qvod_hash3 = http2qvod($http_hash3, 8);
$qvod_hash4 = http2qvod($http_hash4, 1);
break;
}
return array($qvod_hash0, $qvod_hash1, $qvod_hash2, $qvod_hash3, $qvod_hash4);
}
function qvod2http($hash, $rol) {
$inter_value = int32_shr($hash & -16777216, 8) | (($hash & 0x00ff0000) << 8) | int32_shr($hash & 0x0000ff00, 8) | (($hash & 0x000000ff) << 8);
$inter_value = int32_shr($inter_value, $rol) | ($inter_value << (32 - $rol));
$inter_value = int32_shr($inter_value & -16777216, 8) | (($inter_value & 0x00ff0000) << 8) | int32_shr($inter_value & 0x0000ff00, 8) | (($inter_value & 0x000000ff) << 8);
return $inter_value ^ 0x694A873C;
}
function qvod_hash_to_http_hash($qvod_hash0, $qvod_hash1, $qvod_hash2, $qvod_hash3, $qvod_hash4) {
$http_hash0 = qvod2http($qvod_hash0, 1);
$key = $qvod_hash0 & 0x00000F00;
switch($key) {
case 0x00000000:
case 0x00000400:
case 0x00000800:
case 0x00000C00:
$http_hash1 = qvod2http($qvod_hash1, 1);
$http_hash2 = qvod2http($qvod_hash2, 1);
$http_hash3 = qvod2http($qvod_hash3, 1);
$http_hash4 = qvod2http($qvod_hash4, 1);
break;
case 0x00000100:
case 0x00000500:
case 0x00000900:
case 0x00000D00:
$http_hash1 = qvod2http($qvod_hash1, 9);
$http_hash2 = qvod2http($qvod_hash2, 1);
$http_hash3 = qvod2http($qvod_hash3, 9);
$http_hash4 = qvod2http($qvod_hash4, 1);
break;
case 0x00000200:
case 0x00000600:
case 0x00000A00:
case 0x00000E00:
$http_hash1 = qvod2http($qvod_hash1, 9);
$http_hash2 = qvod2http($qvod_hash2, 7);
$http_hash3 = qvod2http($qvod_hash3, 1);
$http_hash4 = qvod2http($qvod_hash4, 9);
break;
default:
$http_hash1 = qvod2http($qvod_hash1, 9);
$http_hash2 = qvod2http($qvod_hash2, 7);
$http_hash3 = qvod2http($qvod_hash3, 8);
$http_hash4 = qvod2http($qvod_hash4, 1);
break;
}
return array($http_hash0, $http_hash1, $http_hash2, $http_hash3, $http_hash4);
}

$http_url = "http://x.poxiao.me:1234/189224990/3BA3B4EA759CA9043F887B1B29985677DB38AD03/东京暗鸦_2013_HDTV_01.mp4";
echo $http_url . "<br />";
$url_pattern = '/^http:\/\/[^\/]+(:\d+)?\/(?<file_size>\d+)\/(?<http_hash>[0-9a-fA-F]{40})\/(?<file_name>[^\/]+)(\/)?$/i';
preg_match($url_pattern, $http_url, $matches);
$http_hash = $matches["http_hash"];
$http_hash0 = hex_string_to_integer(substr($http_hash, 0, 8));
$http_hash1 = hex_string_to_integer(substr($http_hash, 8, 8));
$http_hash2 = hex_string_to_integer(substr($http_hash, 16, 8));
$http_hash3 = hex_string_to_integer(substr($http_hash, 24, 8));
$http_hash4 = hex_string_to_integer(substr($http_hash, 32, 8));
$qvod_hash_array = http_hash_to_qvod_hash($http_hash0, $http_hash1, $http_hash2, $http_hash3, $http_hash4);
$qvod_hash = strtoupper(dechex($qvod_hash_array[0])) . strtoupper(dechex($qvod_hash_array[1])) . strtoupper(dechex($qvod_hash_array[2])) . strtoupper(dechex($qvod_hash_array[3])) . strtoupper(dechex($qvod_hash_array[4]));
$qvod_url = "qvod://" . $matches["file_size"] . '|' . $qvod_hash . '|' . $matches["file_name"] . '|';
echo $qvod_url . "<br />";
$qvod_hash0 = $qvod_hash_array[0];
$qvod_hash1 = $qvod_hash_array[1];
$qvod_hash2 = $qvod_hash_array[2];
$qvod_hash3 = $qvod_hash_array[3];
$qvod_hash4 = $qvod_hash_array[4];
$http_hash_array = qvod_hash_to_http_hash($qvod_hash0, $qvod_hash1, $qvod_hash2, $qvod_hash3, $qvod_hash4);
$http_hash_cvt = strtoupper(dechex($http_hash_array[0])) . strtoupper(dechex($http_hash_array[1])) . strtoupper(dechex($http_hash_array[2])) . strtoupper(dechex($http_hash_array[3])) . strtoupper(dechex($http_hash_array[4]));
$http_url_cvt = "http://x.poxiao.me:1234/" . $matches["file_size"] . "/" . $http_hash_cvt . "/" . $matches["file_name"];
echo $http_url_cvt . "<br />";
?>
文章目录