Example usage for java.util Random toString

List of usage examples for java.util Random toString

Introduction

In this page you can find the example usage for java.util Random toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:com.k42b3.neodym.oauth.Oauth.java

private String getNonce() {
    try {/*from   ww  w  . ja v  a  2  s . c  om*/
        byte[] nonce = new byte[32];

        Random rand;

        rand = SecureRandom.getInstance("SHA1PRNG");

        rand.nextBytes(nonce);

        return DigestUtils.md5Hex(rand.toString());
    } catch (Exception e) {
        return DigestUtils.md5Hex("" + System.currentTimeMillis());
    }
}