Package java.security

Examples of java.security.SecureRandom.nextBoolean()


            sr = SecureRandom.getInstance("PRNG", "SunMSCAPI");
            long start = System.nanoTime();
            int x = 0;
            for(int i = 0; i < 10000; i++) {
                if (i % 100 == 0) System.err.print(".");
                if (sr.nextBoolean()) x++;
            };
            t = (System.nanoTime() - start) / 1000000000.0;
            System.err.println("\nSpend " + t + " seconds");
        } catch (Exception e) {
            // Not supported here, maybe not a Win32
View Full Code Here


        tempoClient.init(pipaID, tempoClient.createMessageAsDocument(pipa, "abr_initPipa.ftl"));
        Thread.sleep(SLEEP_TIME);
        String id = tempoClient.getAvailableTasks("PATask", "T._description like '%Approval%' ORDER BY T._creationDate DESC")[0].getID();
        SecureRandom r = new SecureRandom();
        for (int i = 0; i < 10; i++) {
            if (r.nextBoolean()) {
              tempoClient.claim(id, paramUser);
            } else {
              tempoClient.revoke(id);
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.