summaryrefslogtreecommitdiff
path: root/test/http/zstd_test_arrays.hpp
blob: 2835e6159a0f09e191650699918207b0c844bd78 (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright OpenBMC Authors

#pragma once

#include <array>

namespace bmcweb
{
namespace zstd
{
// A 1MB file of all ones created using
// dd if=/dev/zero bs=1024 count=1024 | tr "\000" "\377" > ones-file
// zstd -c ones-file | xxd -i
constexpr std::array<unsigned char, 54> ones = {
    0x28, 0xb5, 0x2f, 0xfd, 0xa4, 0x00, 0x00, 0x10, 0x00, 0x54, 0x00,
    0x00, 0x10, 0xff, 0xff, 0x01, 0x00, 0xfb, 0xff, 0x39, 0xc0, 0x02,
    0x02, 0x00, 0x10, 0xff, 0x02, 0x00, 0x10, 0xff, 0x02, 0x00, 0x10,
    0xff, 0x02, 0x00, 0x10, 0xff, 0x02, 0x00, 0x10, 0xff, 0x02, 0x00,
    0x10, 0xff, 0x03, 0x00, 0x10, 0xff, 0xb4, 0xc8, 0xba, 0x13};

// A 1MB file of all zeros created using
// dd if=/dev/zero of=zeros-file bs=1024 count=1024
// zstd -c zeros-file | xxd -i
constexpr std::array<unsigned char, 54> zeros = {
    0x28, 0xb5, 0x2f, 0xfd, 0xa4, 0x00, 0x00, 0x10, 0x00, 0x54, 0x00,
    0x00, 0x10, 0x00, 0x00, 0x01, 0x00, 0xfb, 0xff, 0x39, 0xc0, 0x02,
    0x02, 0x00, 0x10, 0x00, 0x02, 0x00, 0x10, 0x00, 0x02, 0x00, 0x10,
    0x00, 0x02, 0x00, 0x10, 0x00, 0x02, 0x00, 0x10, 0x00, 0x02, 0x00,
    0x10, 0x00, 0x03, 0x00, 0x10, 0x00, 0xf1, 0x3e, 0x16, 0xe1};

// A 0 byte file created using
// touch empty-file
// zstd -c empty-file | xxd -i
constexpr std::array<unsigned char, 13> empty{
    0x28, 0xb5, 0x2f, 0xfd, 0x24, 0x00, 0x01,
    0x00, 0x00, 0x99, 0xe9, 0xd8, 0x51};

} // namespace zstd
} // namespace bmcweb