aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/maennchen/zipstream-php/src/Zip64/DataDescriptor.php
blob: 041c5579d7505ca51053970bb8e23b7fff824e14 (plain) (blame)
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
<?php

declare(strict_types=1);

namespace ZipStream\Zip64;

use ZipStream\PackField;

/**
 * @internal
 */
abstract class DataDescriptor
{
    private const SIGNATURE = 0x08074b50;

    public static function generate(
        int $crc32UncompressedData,
        int $compressedSize,
        int $uncompressedSize,
    ): string {
        return PackField::pack(
            new PackField(format: 'V', value: self::SIGNATURE),
            new PackField(format: 'V', value: $crc32UncompressedData),
            new PackField(format: 'P', value: $compressedSize),
            new PackField(format: 'P', value: $uncompressedSize),
        );
    }
}