- Thoughts - http://peelle.org -

ESN Conversion

Posted By Jeremy On 2010-01-13 @ 10:36 In Mobile, ESN, Perl | 1 Comment

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 [1] 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.


Article printed from Thoughts: http://peelle.org

URL to article: http://peelle.org/archives/15

URLs in this post:
[1] smidgen of knowledge: http://www.timgineer.com/message/kyleti/2007/how-esns-work

Click here to print.