Optimize unique serial number reading code for size -- remove atoi/toupper references, replace with hand-rolled code as the input has known size constraints.