CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
HexUtil.h
Go to the documentation of this file.
1
5
6#pragma once
7
8namespace cdc::plugin_manager {
9
15inline int hex_val(char c)
16{
17 if (c >= '0' && c <= '9') return c - '0';
18 if (c >= 'a' && c <= 'f') return c - 'a' + 10;
19 if (c >= 'A' && c <= 'F') return c - 'A' + 10;
20 return -1;
21}
22
23} // namespace cdc::plugin_manager
int hex_val(char c)
Convert a single hex digit to its numeric value.
Definition HexUtil.h:15