Add vitastor-cli create & modify --enc-key parameter
This commit is contained in:
@@ -565,3 +565,17 @@ std::string tohexstr(const uint8_t *from, size_t bytes)
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
bool ishexstr(const std::string & str)
|
||||
{
|
||||
if (str.size() % 2)
|
||||
return false;
|
||||
for (auto & c: str)
|
||||
{
|
||||
if ((c < '0' || c > '9') &&
|
||||
(c < 'a' || c > 'f') &&
|
||||
(c < 'A' || c > 'F'))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -37,5 +37,6 @@ bool is_zero(void *buf, size_t size);
|
||||
std::string urldecode(const std::string & orig);
|
||||
size_t fromhexstr(const std::string & from, size_t bytes, uint8_t *to);
|
||||
std::string tohexstr(const uint8_t *from, size_t bytes);
|
||||
bool ishexstr(const std::string & str);
|
||||
|
||||
#pragma GCC visibility pop
|
||||
|
||||
Reference in New Issue
Block a user