12 // A pill is a unit of entropy.
18 bool operator==(Pill
const& that
) const { return this->s_
== that
.s_
; }
19 bool operator!=(Pill
const& that
) const { return !(*this == that
); }
21 std::string_view
as_string_view() const
23 return std::string_view
{b32_str_
, strlen(b32_str_
)};
27 unsigned long long s_
;
29 auto static constexpr b32_ndigits_
= ((sizeof(s_
) * CHAR_BIT
) + 4) / 5;
30 char b32_str_
[b32_ndigits_
+ 1];
32 friend std::ostream
& operator<<(std::ostream
& s
, Pill
const& p
)
34 return s
<< p
.b32_str_
;
37 inline static pcg_extras::seed_seq_from
<std::random_device
> seed_source_
;
38 inline static pcg64 rng_
{seed_source_
};
41 #endif // PILL_DOT_HPP