[英]User registration verification with their device IMEI/ESN?
I am working on an application that will validate users with their device IMEI/ESN number and keep records of all previous IMEI/ESN if user changes device, is there any useful way. 我正在开发一个应用程序,该应用程序将使用其设备的IMEI / ESN编号验证用户,并在用户更改设备时保留所有以前的IMEI / ESN的记录,是否有任何有用的方法。 I already get device IMEI/ESN but how I use it for user verification? 我已经获得设备IMEI / ESN,但如何使用它进行用户验证?
Alternative Question: If it is not possible then how i'll send 4 digit code(like viber) on user number after register into application? 替代问题:如果不可能,那么在注册到应用程序后如何在用户编号上发送4位代码(如viber)?
Alternative Question: If it is not possible then how i'll send 4 digit code(like viber) on user number after register into application ? 替代问题:如果不可能,那么在注册到应用程序后如何发送4位数字代码(如viber)?
You can generate unique alpha-numeric strings from server side and Map as per your requirement . 您可以根据需要从服务器端和Map生成唯一的字母数字字符串。
if you are using java server then following code would help 如果您使用的是Java服务器,则以下代码将有所帮助
import java.util.Random;
public class RandomString
{
private static final char[] symbols = new char[36];
static {
for (int idx = 0; idx < 10; ++idx)
symbols[idx] = (char) ('0' + idx);
for (int idx = 10; idx < 36; ++idx)
symbols[idx] = (char) ('a' + idx - 10);
}
private final Random random = new Random();
private final char[] buf;
public RandomString(int length)
{
if (length < 1)
throw new IllegalArgumentException("length < 1: " + length);
buf = new char[length];
}
public String nextString()
{
for (int idx = 0; idx < buf.length; ++idx)
buf[idx] = symbols[random.nextInt(symbols.length)];
return new String(buf);
}
} }
and if you server language is PHP then you can do something like this using MD% 如果您的服务器语言是PHP,则可以使用MD%执行类似的操作
md5(uniqid(rand(), true))
however the length of the input of the md5 function is greater than length of its output and according to the en.wikipedia.org/wiki/Pigeonhole_principle the collision is guaranteed so uniqueness is not guarantee in that case 但是md5函数的输入长度大于其输出的长度,并且根据en.wikipedia.org/wiki/Pigeonhole_principle ,冲突得到保证,因此在这种情况下不能保证唯一性
After that you need to MAP those key and value using web service 之后,您需要使用Web服务映射那些键和值
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.