37 constexpr
char hexmap[] =
"0123456789abcdef";
39 for (
int i = 0;
i < length; ++
i) {
40 os << hexmap[(data[i] & 0xF0) >> 4];
56 void hex2bin(
const char *in,
int length,
char *out) {
57 for (
int i = 0;
i < length;
i += 2) {
60 *out++ = nibble1 << 4 | nibble2;
76 std::ofstream fout(
name, std::ios::out | std::ios::binary);
82 for (
int i = 0;
i < argc; ++
i) {
83 if (strcmp(argv[
i],
option) == 0) {
92 for (
int i = 0;
i < argc - 1; ++
i) {
93 if (strcmp(argv[
i],
option) == 0 && (out = atoi(argv[
i + 1])) > 0) {
101 for (
int i = 0;
i < argc - 1; ++
i) {
102 if (strcmp(argv[
i],
option) == 0 && (out = std::strtoull(argv[
i + 1], NULL, 0)) > 0) {
110 for (
int i = 0;
i < argc - 1; ++
i) {
111 if (strcmp(argv[
i],
option) == 0 && (out = atof(argv[
i + 1])) > 0) {
119 for (
int i = 0;
i < argc; ++
i) {
120 if (*argv[
i] !=
'-' && (out = atoi(argv[
i])) > 0) {
char parseNibble(char hex)
Definition: utility.hpp:45
int * count
Definition: gmock_stress_test.cc:176
void dump(const char *buffer, uint64_t count, const char *name)
Definition: utility.hpp:75
int i
Definition: pymoduletest.py:23
constexpr bool stringsEqual(char const *a, char const *b)
Definition: utility.hpp:64
void readFloatOption(const char *option, int argc, char **argv, double &out, double defaultValue)
Definition: utility.hpp:109
void readUInt64Option(const char *option, int argc, char **argv, uint64_t &out, uint64_t defaultValue)
Definition: utility.hpp:100
bool equalsHex(const void *hash, const char(&hex)[N])
Definition: utility.hpp:69
std::string data
Definition: base58.cpp:37
void hex2bin(const char *in, int length, char *out)
Definition: utility.hpp:56
const T buffer
Definition: byte_slice.cpp:83
void readOption(const char *option, int argc, char **argv, bool &out)
Definition: utility.hpp:81
unsigned __int64 uint64_t
Definition: stdint.h:136
constexpr char hexmap[]
Definition: utility.hpp:37
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
void readIntOption(const char *option, int argc, char **argv, int &out, int defaultValue)
Definition: utility.hpp:91
void readInt(int argc, char **argv, int &out, int defaultValue)
Definition: utility.hpp:118
void outputHex(std::ostream &os, const char *data, int length)
Definition: utility.hpp:38
POD_CLASS hash
Definition: hash.h:49
const GenericPointer< typename T::ValueType > T2 defaultValue
Definition: pointer.h:1124
const char * name
Definition: options.c:30
static constexpr const char hex[]
Definition: wipeable_string.cpp:36
cryptonote::block b
Definition: block.cpp:40
Definition: blockchain_usage.cpp:71