Info
You are currently browsing the archives for the Perl category.
Calendar
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Jan | ||||||
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 | ||||
Latest Postings
Links
Shopping
Tech
Archives
Archive for the Perl Category
ESN Conversion
2010-01-13 by Jeremy.
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.
Posted in Mobile, ESN, Perl | Print | No Comments »
|