Quick actions

cmd+k|ctrl+k

Navigation

Languages

Untitled

Snippet info

Language

Raku

Visibility

unlisted

Author

legacy-anonymous

Created

2026-06-26T02:57:50.007793Z

Updated

2026-06-26T02:57:50.007793Z

submethod TWEAK {
    my %info       = $!raw-content<info>;
    $!name         = %info<name>;
    $!info-hash    = sha1(bencode(%info));
    # $!tracker-url =
    $!piece-length = %info<<'piece length'>>;
    @!pieces       = %info<pieces>.list.comb(20);
    @!files        = %info<files>:exists
				                      ?? %info<files>.map: {%(:path(.<path>.join('/')), :length(.<length>))}
                                      !! [ %(:path($!name), :length(%info<length>)) ];
    $!total-size   = @!files>>.<length>.sum;
    say @!files>>.<length>.raku;
    say @!files.raku;
}

# @!files become:
# [:length(661651456), :path("debian-12.6.0-amd64-netinst.iso")]
INFO