如何编写代码以生成oauth nonce
的{{1}}。
Nonce在Twitter上的长度为15个字符
建议示例/链接/代码?
答案 0 :(得分:1)
import java.security.SecureRandom;
public static String nonceGenerator(){
SecureRandom secureRandom = new SecureRandom();
StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < 15; i++) {
stringBuilder.append(secureRandom.nextInt(10));
}
String randomNumber = stringBuilder.toString();
return randomNumber;
}
查看我的帖子了解更多信息: https://www.pythonorjava.com/single-post/2017/03/07/Secure-Random-Number-Generator-nonce