1
// Copyright © 2017-2020 Trust Wallet.
2
//
3
// This file is part of Trust. The full Trust copyright notice, including
4
// terms governing use, modification, and redistribution, is contained in the
5
// file LICENSE at the root of the source code distribution tree.
6

7
#include "Data.h"
8

9
namespace TW {
10

11 1
Data subData(const Data& data, size_t index, size_t length) {
12 1
    size_t subLength = length;
13 1
    if (index + subLength > data.size()) { subLength = data.size() - index; } // guard against over-length
14 1
    return TW::data(data.data() + index, subLength);
15
}
16

17
} // namespace TW

Read our documentation on viewing source code .

Loading