Faker C++
Loading...
Searching...
No Matches
number.h File Reference
#include <concepts>
#include <optional>
#include <random>
#include <stdexcept>
#include "faker-cxx/export.h"
#include "faker-cxx/types/hex.h"
Include dependency graph for number.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  faker
 
namespace  faker::number
 

Functions

template<std::integral I>
faker::number::integer (I min, I max)
 Generates a random integer number in the given range, bounds included.
 
template<std::integral I>
faker::number::integer (I max)
 Generates a random integer between 0 and the given maximum value, bounds included.
 
FAKER_CXX_EXPORT std::string faker::number::hexadecimal (unsigned length=1, HexCasing casing=HexCasing::Lower, HexPrefix prefix=HexPrefix::ZeroX)
 Generates a random decimal number in the given range, bounds included.
 
FAKER_CXX_EXPORT std::string faker::number::hexadecimal (std::optional< int > min=std::nullopt, std::optional< int > max=std::nullopt)
 Returns a lowercase hexadecimal number.
 
FAKER_CXX_EXPORT std::string faker::number::octal (unsigned length=1)
 Generates an octal string.
 
FAKER_CXX_EXPORT std::string faker::number::binary (int length=1)
 Generates a binary string of a specified length.
 
FAKER_CXX_EXPORT std::string faker::number::binary (int min, int max)
 Generates a random binary string which has its decimal equivalent between min and max inclusive.