Archive for January 13th, 2010

ESN Conversion

Wednesday, January 13th, 2010

Today, our Sprint Liaison passed a spreadsheet with 100+ decimal ESN numbers matched to our phone numbers. Our cards report ESN numbers in Hex. Turns out there’s a smidgen of knowledge needed to switching between the two.

Then you get something like this.

perl -nE 'say hex( substr($_, 0, 2) ) . hex( substr($_, 2) );'

perl -nE 'say uc(sprintf("%x%x", substr($_, 0, 3), substr($_, 3 ) ));'

Happy Coding.