|
dasmig-core 1.2.0
Shared random engine, distributions and data tiers for the dasmig generator libraries
|
What a result needs to be generated again: its call seed and the data it was generated from. More...
#include <seed_signature.hpp>
Public Member Functions | |
| std::string | to_string () const |
| The text form. | |
| void | to_json (json_writer &w) const |
Write as a JSON object {"seed":"…","data":"…"}. | |
Static Public Member Functions | |
| static seed_signature | parse (std::string_view text) |
| Parse the text form. A lone seed (16 hex digits) is accepted with data 0. | |
Public Attributes | |
| std::uint64_t | seed {0} |
| The call seed. | |
| std::uint64_t | data {0} |
| Hash of the data used; 0 when not recorded. | |
Friends | |
| constexpr bool | operator== (const seed_signature &, const seed_signature &) noexcept=default |
| Signatures are equal when seed and data are equal. | |
What a result needs to be generated again: its call seed and the data it was generated from.
data is the layered_table::data_hash() (or a combination of several) of the data loaded when the result was made; 0 means "not recorded". A seed replays the same result only against the same data, so a replay can compare data and report a mismatch instead of returning a different result silently.
The text form is <seed>-<data>, each 16 lowercase hex digits, for example 00000000000004d2-9ae16a3b2f90404f. In JSON both parts are strings, because JavaScript numbers cannot hold every 64-bit value.
Definition at line 39 of file seed_signature.hpp.
|
inlinestatic |
Parse the text form. A lone seed (16 hex digits) is accepted with data 0.
| text | <seed>-<data> or <seed>. |
| std::invalid_argument | If text is not in that form. |
Definition at line 56 of file seed_signature.hpp.
|
inline |
Write as a JSON object {"seed":"…","data":"…"}.
| w | Writer positioned where a value is allowed. |
Definition at line 73 of file seed_signature.hpp.
|
inline |
The text form.
<seed>-<data> in 16-digit lowercase hex. Definition at line 46 of file seed_signature.hpp.
| std::uint64_t dasmig::core::seed_signature::data {0} |
Hash of the data used; 0 when not recorded.
Definition at line 42 of file seed_signature.hpp.
| std::uint64_t dasmig::core::seed_signature::seed {0} |
The call seed.
Definition at line 41 of file seed_signature.hpp.