puntito
Programmer
- Mar 22, 2006
- 18
I have this information ...
For nearly two decades, electronic serial numbers (ESN) have served CDMA and other wireless technologies well, providing a mechanism to uniquely identify each mobile device. But just as IP address pool depletion is leading the change from IPv4 to IPv6, the impending exhaustion of available ESNs necessitates a replacement. That replacement is the mobile equipment identifier (MEID).
This page, provide more info.
My Question is, I have to transform de MEID to a psedi ESN (electronic Serial Number), but I cant find a way to do it.
I have this code
to Execute: cad = ConvierteExaDec.SHA1("FF000001123456");
------------------------
I was told that I have to take a 56 bit hex number (MEID) and convert it to a 32 bit hex number (pESN).
The end result should look like this..
*The upper 8 bits of pseudo-ESN shall be set to 0x80.
* The lower 24 bits of pseudo-ESN shall be the 24 least significant bits of the SHA-1 digest of the MEID.
So the pESN should be 80 XX XX XX.
An example is this..
Example:
if the 56-bit MEID is (hexadecimal) FF 00 00 01 12 34 56, the pseudo-ESN is (hexadecimal) 80 07 37 E1.
I can't get this to compute..
So I need to get the 24 least significant bits and convert it to hex and some how it'll equal 07 37 E1.
Somebody could help me please !!
I hope I could explain me well!!!!!
For nearly two decades, electronic serial numbers (ESN) have served CDMA and other wireless technologies well, providing a mechanism to uniquely identify each mobile device. But just as IP address pool depletion is leading the change from IPv4 to IPv6, the impending exhaustion of available ESNs necessitates a replacement. That replacement is the mobile equipment identifier (MEID).
This page, provide more info.
My Question is, I have to transform de MEID to a psedi ESN (electronic Serial Number), but I cant find a way to do it.
I have this code
Code:
private static String convertToHex(byte[] data) {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < data.length; i++) {
int halfbyte = (data[i] >>> 4) & 0x0F;
int two_halfs = 0;
do {
if ((0 <= halfbyte) && (halfbyte <= 9))
buf.append((char) ('0' + halfbyte));
else
buf.append((char) ('a' + (halfbyte - 10)));
halfbyte = data[i] & 0x0F;
} while(two_halfs++ < 1);
}
return buf.toString();
}
public static String SHA1(String text)
throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md;
md = MessageDigest.getInstance("SHA-1");
byte[] sha1hash = new byte[20];
md.update(text.getBytes("iso-8859-1"), 0, text.length());
sha1hash = md.digest();
String yy =convertToHex(sha1hash);
//return yy;
return convertirlo(yy);
}
public static String convertirlo(String toHex){
String x = toHex;
//String y = x.substring(0,6);
String y = x.substring(x.length()-6,x.length());
byte[] bait = new byte[20];
try {
bait = y.getBytes("iso-8859-1");
} catch (UnsupportedEncodingException e) {
// TODO Bloque catch generado automáticamente
e.printStackTrace();
}
x = convertToHex(bait);
return y;
}
to Execute: cad = ConvierteExaDec.SHA1("FF000001123456");
------------------------
I was told that I have to take a 56 bit hex number (MEID) and convert it to a 32 bit hex number (pESN).
The end result should look like this..
*The upper 8 bits of pseudo-ESN shall be set to 0x80.
* The lower 24 bits of pseudo-ESN shall be the 24 least significant bits of the SHA-1 digest of the MEID.
So the pESN should be 80 XX XX XX.
An example is this..
Example:
if the 56-bit MEID is (hexadecimal) FF 00 00 01 12 34 56, the pseudo-ESN is (hexadecimal) 80 07 37 E1.
I can't get this to compute..
So I need to get the 24 least significant bits and convert it to hex and some how it'll equal 07 37 E1.
Somebody could help me please !!
I hope I could explain me well!!!!!