line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::DAAP::Client::v2; |
2
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
35
|
|
4
|
1
|
|
|
1
|
|
5
|
use Digest::MD5; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
311
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
my @seeds; |
7
|
|
|
|
|
|
|
sub validate { |
8
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
9
|
0
|
|
|
|
|
|
my ($url, $select) = @_; |
10
|
0
|
0
|
|
|
|
|
unless (@seeds) { |
11
|
0
|
|
|
|
|
|
for my $i (0..255) { |
12
|
0
|
|
|
|
|
|
my $ctx = Digest::MD5->new; |
13
|
0
|
0
|
|
|
|
|
$ctx->add( $i & 0x80 ? "Accept-Language" : "user-agent" ); |
14
|
0
|
0
|
|
|
|
|
$ctx->add( $i & 0x40 ? "max-age" : "Authorization" ); |
15
|
0
|
0
|
|
|
|
|
$ctx->add( $i & 0x20 ? "Client-DAAP-Version" : "Accept-Encoding" ); |
16
|
0
|
0
|
|
|
|
|
$ctx->add( $i & 0x10 ? "daap.protocolversion": "daap.songartist" ); |
17
|
0
|
0
|
|
|
|
|
$ctx->add( $i & 0x08 ? "daap.songcomposer" : "daap.songdatemodified" ); |
18
|
0
|
0
|
|
|
|
|
$ctx->add( $i & 0x04 ? "daap.songdiscnumber" : "daap.songdisabled" ); |
19
|
0
|
0
|
|
|
|
|
$ctx->add( $i & 0x02 ? "playlist-item-spec" : "revision-number" ); |
20
|
0
|
0
|
|
|
|
|
$ctx->add( $i & 0x01 ? "session-id" : "content-codes" ); |
21
|
0
|
|
|
|
|
|
push @seeds, uc $ctx->hexdigest; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
my $ctx = Digest::MD5->new; |
26
|
0
|
|
|
|
|
|
$ctx->add( $url ); |
27
|
0
|
|
|
|
|
|
$ctx->add( "Copyright 2003 Apple Computer, Inc." ); |
28
|
0
|
|
|
|
|
|
$ctx->add( $seeds[ $select ]); |
29
|
0
|
|
|
|
|
|
return uc $ctx->hexdigest; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|