src/Keeg.Crypto/Common/Utils.cs
/// <summary>
/// Converts a hex character to it's numeric representation.
/// </summary>
/// <param name="c">The hex character to convert.</param>
/// <returns>An <see cref="int"/> representing the hex character.</returns>
/// <exception cref="ArgumentOutOfRangeException">
/// Must be in the range 0..9, a..z, A..Z
/// </exception>
Converts a hex character to it's numeric representation.
Converts a hex character to it ' s numeric representation .
internal static int ParseNybble(char c)
        {
            if (c >= '0' && c <= '9')
            {
                return c - '0';
            }
            c = (char)(c & ~0x20);
            if (c >= 'A' && c <= 'F')
            {
                return c - ('A' - 10);
            }
            throw new ArgumentOutOfRangeException(nameof(c), $"Invalid nybble: {c}");
        }
internal static int ParseNybble ( char c ) { if ( c >= ' ' && c <= ' ' ) { return c - ' ' ; } c = ( char ) ( c & ~ 0x20 ) ; if ( c >= ' ' && c <= ' ' ) { return c - ( ' ' - 10 ) ; } throw new ArgumentOutOfRangeException ( nameof ( c ) , $" Invalid nybble:  { c } " ) ; }
Converts a hex character to it's numeric representation.
Converts a hex character to it ' s numeric representation .
An  representing the hex character.
An representing the hex character .
Must be in the range 0..9, a..z, A..Z
Must be in the range 0 .. 9 a .. z A .. Z
c
char
The hex character to convert.
The hex character to convert .