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