HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //proc/self/root/usr/share/perl5/Archive/Cpio/Common.pm
package Archive::Cpio::Common;

use Archive::Cpio::FileHandle_with_pushback;

use Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(padding write_or_die max begins_with);

sub magics() {
    {
        "070707" => 'ODC',
        "070701" => 'NewAscii',
        "\xC7\x71" => 'OldBinary', # swabbed 070707
        "\x71\xC7" => 'OldBinary', # 070707
    };
}

sub padding {
    my ($nb, $offset) = @_;

    my $align = $offset % $nb;
    $align ? $nb - $align : 0;
}

sub write_or_die {
    my ($F, $val) = @_;
    print $F $val or die "writing failed: $!\n";
}

sub max  { my $n = shift; $_ > $n and $n = $_ foreach @_; $n }
sub begins_with {
    my ($s, $prefix) = @_;
    index($s, $prefix) == 0;
}

1;