File: test-utils.cpp

package info (click to toggle)
bc-ur 0.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 620 kB
  • sloc: cpp: 2,172; ansic: 738; sh: 339; makefile: 225
file content (22 lines) | stat: -rw-r--r-- 511 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//
//  test-utils.cpp
//
//  Copyright © 2020 by Blockchain Commons, LLC
//  Licensed under the "BSD-2-Clause Plus Patent License"
//

#include "test-utils.hpp"

using namespace ur;

ByteVector make_message(size_t len, const std::string& seed) {
    auto rng = Xoshiro256(seed);
    return rng.next_data(len);
}

UR make_message_ur(size_t len, const std::string& seed) {
    auto message = make_message(len, seed);
    ByteVector cbor;
    CborLite::encodeBytes(cbor, message);
    return UR("bytes", cbor);
}