mirror of https://github.com/oxen-io/lokinet
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
340 B
C++
19 lines
340 B
C++
6 years ago
|
#include <util/encode.hpp>
|
||
|
|
||
6 years ago
|
#include <stdexcept>
|
||
6 years ago
|
|
||
6 years ago
|
namespace llarp
|
||
6 years ago
|
{
|
||
6 years ago
|
int
|
||
|
char2int(char input)
|
||
6 years ago
|
{
|
||
|
if(input >= '0' && input <= '9')
|
||
|
return input - '0';
|
||
|
if(input >= 'A' && input <= 'F')
|
||
|
return input - 'A' + 10;
|
||
|
if(input >= 'a' && input <= 'f')
|
||
|
return input - 'a' + 10;
|
||
6 years ago
|
return 0;
|
||
6 years ago
|
}
|
||
6 years ago
|
} // namespace llarp
|