1#ifndef LIBFILEZILLA_UTIL_HEADER
2#define LIBFILEZILLA_UTIL_HEADER
72 std::enable_if_t<
sizeof(
typename First::value_type) ==
sizeof(
uint8_t) &&
73 sizeof(
typename Second::value_type) ==
sizeof(
uint8_t)>* =
nullptr>
77 std::basic_string_view<uint8_t>(
reinterpret_cast<uint8_t const*
>(
rhs.data()),
rhs.size()));
94template<
typename T,
typename std::enable_if_t<std::is_final_v<T>>* =
nullptr>
98 new (
p)
T(std::move(
op));
The buffer class is a simple buffer where data can be appended at the end and consumed at the front....
Definition buffer.hpp:27
The duration class represents a time interval in milliseconds.
Definition time.hpp:291
Sets some global macros and further includes string.hpp.
The namespace used by libfilezilla.
Definition apply.hpp:17
std::vector< uint8_t > random_bytes(size_t size)
Get random uniformly distributed bytes.
T & move_assign_through_move_constructor(T *p, T &&op) noexcept
Helper to move-assign guaranteeing same member destruction order as the destructor.
Definition util.hpp:95
void yield()
Relinquish control for a brief amount of time.
uint64_t bitscan(uint64_t v)
Returns index of the least-significant set bit.
int64_t random_number(int64_t min, int64_t max)
Get a secure random integer uniformly distributed in the closed interval [min, max].
bool dispatch(event_base const &ev, F &&f)
Dispatch for simple_event<> based events to simple functors.
Definition event_handler.hpp:199
void sleep(duration const &d)
Sleep current thread for the specified duration.
uint64_t bitscan_reverse(uint64_t v)
Returns index of the most-significant set bit.
bool equal_consttime(std::basic_string_view< uint8_t > const &lhs, std::basic_string_view< uint8_t > const &rhs)
Secure equality test in constant time.
Assorted classes dealing with time.