Skip to content

SAIF.Framework.BaseN operations and processes

This page is the operation catalog and cross-operation hub for this library. Each operation's detailed, step-by-step logic lives in its own page under operations/.

Operation catalog

Operation Intent Trigger Inputs Outputs Rules Tables SQL
Decode BaseN string to decimal Reads a BaseN character sequence and resolves it to its decimal value. Caller invokes BaseNToDecimal on a string. Source string, IConverter Decimal Long BR-001, BR-002, BR-004 — —
Encode decimal to BaseN string Renders a decimal value as a BaseN string in the caller's chosen base. Caller invokes DecimalToBaseN on an Integer or Long. Decimal Integer or Long, IConverter BaseN string BR-001, BR-002, BR-003 — —
Format digit array as BaseN string Assembles a digit array into the converter's final string output, applying Excel-specific rollover where needed. Encode flow or direct IConverter.FormatBaseN call. Integer digit array Formatted BaseN string BR-001, BR-002, BR-003 — —
Convert alpha digit to numeric value Resolves a single character token to the numeric digit value the active converter expects. Decode flow, encode re-tokenization, or direct IConverter call. Single-character string token Integer digit value BR-001, BR-002, BR-004 — —
Convert numeric digit to alpha representation Resolves one numeric digit to the string token the active converter renders. Encode recursion, formatting flow, or direct IConverter call. Integer digit value String token BR-001, BR-002, BR-003 — —

Process flow diagram

The following diagram visualizes the primary operational flow across operations, showing how decoding and encoding each delegate to the shared digit-conversion operations.

flowchart TD
    Start([Caller requests conversion]) --> Decision{Decode or encode?}
    Decision -->|Decode| Decode[Decode BaseN string to decimal]
    Decode --> Alpha[Convert alpha digit to numeric value]
    Alpha --> Sum[Accumulate positional decimal value]
    Sum --> EndDecode([Return decimal result])
    Decision -->|Encode| Encode[Encode decimal to BaseN string]
    Encode --> Numeric[Convert numeric digit to alpha representation]
    Numeric --> Format[Format digit array as BaseN string]
    Format --> EndEncode([Return BaseN string])

Failure and edge-case behavior

  • BaseNToDecimal consumes the input string one character at a time and never strips delimiters or groups multi-character segments first, so any pre-formatted or delimited BaseN string must be normalized by the caller before decoding.
  • ConverterBase.ConvertAlphaToNumeric silently returns 0 for non-numeric input rather than failing. Because BinaryConverter and OctalConverter inherit this default without overriding it, they treat invalid characters as zero-valued digits instead of rejecting them (BR-004).
  • HexConverter raises ConverterException for any alphabetic character outside A-F or any numeric value greater than 16, so malformed hex input fails fast rather than producing a partial result (BR-001).
  • ExcelConverter raises ConverterException when a mapped character or numeric digit exceeds 26. Where a digit does resolve successfully, its formatter still rewrites any 0 digit through borrow/rollover logic before the string is emitted, preserving the bijective A-Z, AA-style output (BR-002, BR-003).

Sources

  • SAIF.Framework.BaseN\BaseNConverter.vb
  • SAIF.Framework.BaseN\ConverterBase.vb
  • SAIF.Framework.BaseN\BinaryConverter.vb
  • SAIF.Framework.BaseN\OctalConverter.vb
  • SAIF.Framework.BaseN\HexConverter.vb
  • SAIF.Framework.BaseN\ExcelConverter.vb
  • SAIF.Framework.BaseN\IConverter.vb
  • SAIF.Framework.BaseN\ConverterException.vb