1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00
new database
fift/func bugfixes
This commit is contained in:
ton 2019-11-15 18:02:37 +04:00
parent 950e292264
commit e30d98eb30
110 changed files with 6102 additions and 2075 deletions

View file

@ -301,6 +301,20 @@ typename std::enable_if<std::is_unsigned<T>::value, T>::type hex_to_integer(Slic
return integer_value;
}
template <class T>
Result<typename std::enable_if<std::is_unsigned<T>::value, T>::type> hex_to_integer_safe(Slice str) {
T integer_value = 0;
auto begin = str.begin();
auto end = str.end();
while (begin != end) {
if (!is_hex_digit(*begin)) {
return Status::Error("not a hex digit");
}
integer_value = static_cast<T>(integer_value * 16 + hex_to_int(*begin++));
}
return integer_value;
}
double to_double(Slice str);
template <class T>