Secure Android ID length?

烈酒焚心 提交于 2019-11-28 12:51:56

The following code snippet from AOSP shows how the ANDROID_ID is generated:

SecureRandom random = new SecureRandom();
String newAndroidIdValue = Long.toHexString(random.nextLong());

The method Long.toHexString is known to suppress leading zeros. Therefore prepending the ANDROID_ID with zeros in case it's length is less than 16 should be to correct way to get a full 16 digits ANDROID_ID.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!