HexConverter¶
HexConverter is a concrete ConverterBase subclass that represents base 16 (hexadecimal). It overrides Base, ConvertAlphaToNumeric, and ConvertNumericToAlpha to map hex digits A–F and enforces strict bounds checking.
Purpose¶
- Provide an
IConverterimplementation for hexadecimal (base 16) numeric conversion, including A–F digit mapping.
Context¶
- Namespace:
SAIF.Framework.BaseN - Assembly/package:
SAIF.Framework.BaseN(also bundled into theSAIF.BOF.FrameworkNuGet package)
Public members¶
| Member | Signature | Purpose |
|---|---|---|
Base |
Public Overrides ReadOnly Property Base() As Integer |
Returns 16. |
ConvertAlphaToNumeric |
Public Overrides Function ConvertAlphaToNumeric(ByVal input As String) As Integer |
Numeric input 0–9 returned directly (after bounds check against Base); letters "A"–"F" (case-insensitive) mapped to 10–15; any other value throws ConverterException (BR-001). |
ConvertNumericToAlpha |
Public Overrides Function ConvertNumericToAlpha(ByVal input As Integer) As String |
Maps 10–15 to "A"–"F"; other in-range values returned as their numeric string; throws ConverterException if input > Base (BR-001). |
Inherited public members¶
Members in this section are inherited from ConverterBase in SAIF.Framework.BaseN. They are available on this type through inheritance.
| Member | Signature | Purpose | Origin |
|---|---|---|---|
FormatBaseN |
Public Overridable Function FormatBaseN(ByVal values As Integer()) As String |
Default: renders a digit array right-to-left as a string, using this type's overridden ConvertNumericToAlpha. |
SAIF.Framework.BaseN — ConverterBase |
Behavioral notes¶
- Unlike
ConverterBase's default (silent-zero) behavior,HexConverterthrowsConverterExceptionwhen a digit value exceedsBase(16), enforcing strict input validation (BR-001). - Digit letters are matched case-insensitively via
input.ToUpper.
Constraints and usage notes¶
- Callers must catch
ConverterExceptionwhen passing potentially out-of-range or invalid digit values toConvertAlphaToNumeric/ConvertNumericToAlpha.
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified. Statements marked with † were retrieved from dependency library documentation via the Legends CLI RAG service. They describe inherited behavior from the indicated origin library and should be verified if the dependency version changes.
Sources¶
SAIF.Framework.BaseN\HexConverter.vbSAIF.Framework.BaseN\ConverterBase.vbSAIF.Framework.BaseN\ConverterException.vb