| 1 | package Net::DAAP::Client::v2; | ||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use Digest::MD5; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | my @seeds; | |||||||||
| 7 | 0 | ▶ | sub validate { | ||||||||
|
Subroutine
validate: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||
| 8 | 0 | my $self = shift; | |||||||||
| 9 | 0 | my ($url, $select) = @_; | |||||||||
| 10 | 0 | ▶ | unless (@seeds) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | 0 | for my $i (0..255) { | |||||||||
| 12 | 0 | my $ctx = Digest::MD5->new; | |||||||||
| 13 | 0 | ▶ | $ctx->add( $i & 0x80 ? "Accept-Language" : "user-agent" ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 0 | ▶ | $ctx->add( $i & 0x40 ? "max-age" : "Authorization" ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 15 | 0 | ▶ | $ctx->add( $i & 0x20 ? "Client-DAAP-Version" : "Accept-Encoding" ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | 0 | ▶ | $ctx->add( $i & 0x10 ? "daap.protocolversion": "daap.songartist" ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | 0 | ▶ | $ctx->add( $i & 0x08 ? "daap.songcomposer" : "daap.songdatemodified" ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 18 | 0 | ▶ | $ctx->add( $i & 0x04 ? "daap.songdiscnumber" : "daap.songdisabled" ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | 0 | ▶ | $ctx->add( $i & 0x02 ? "playlist-item-spec" : "revision-number" ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | 0 | ▶ | $ctx->add( $i & 0x01 ? "session-id" : "content-codes" ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 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 | 1; | |||||||||
| 34 | |||||||||||