mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-05 21:20:38 +00:00
18 lines
334 B
C++
18 lines
334 B
C++
#include <encode.hpp>
|
|
#include <stdexcept>
|
|
|
|
namespace llarp
|
|
{
|
|
int
|
|
char2int(char input)
|
|
{
|
|
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;
|
|
return 0;
|
|
}
|
|
} // namespace llarp
|