How to write a code to generate oauth nonce
for twitter api
.
Nonce is 15 character in length for twitter
Suggest examples/links/code?
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;
}
Check out my post for more information: https://www.pythonorjava.com/single-post/2017/03/07/Secure-Random-Number-Generator-nonce
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With