Examples of Random


Examples of org.hornetq.utils.Random

   {
      HornetQBuffer buffer = HornetQBuffers.fixedBuffer(60 * 1024);

      byte[] bytes = new byte[20000];

      Random random = new Random();
      random.getRandom().nextBytes(bytes);

      String str = new String(bytes);

      UTF8Util.saveUTF(buffer, str);

View Full Code Here

Examples of org.jboss.aerogear.crypto.Random

        return encrypt(password, salt, ITERATIONS);
    }

    @Override
    public byte[] encrypt(String password) throws InvalidKeySpecException {
        byte[] salt = new Random().randomBytes();
        return encrypt(password, salt);
    }
View Full Code Here

Examples of org.jruby.util.Random

        RandomType(IRubyObject vseed) {
            this.seed = vseed.convertToInteger();
            if (seed instanceof RubyFixnum) {
                long v = Math.abs(RubyNumeric.num2long(seed));
                if (v == (v & 0xffffffffL)) {
                    this.mt = new Random((int) v);
                } else {
                    int[] ints = new int[2];
                    ints[0] = (int) v;
                    ints[1] = (int) (v >> 32);
                    this.mt = new Random(ints);
                }
            } else if (seed instanceof RubyBignum) {
                BigInteger big = ((RubyBignum) seed).getBigIntegerValue();
                if (big.signum() < 0) {
                    big = big.abs();
                }
                byte[] buf = big.toByteArray();
                int buflen = buf.length;
                if (buf[0] == 0) {
                    buflen -= 1;
                }
                int len = Math.min((buflen + 3) / 4, Random.N);
                int[] ints = bigEndianToInts(buf, len);
                if (len <= 1) {
                    this.mt = new Random(ints[0]);
                } else {
                    this.mt = new Random(ints);
                }
            } else {
                throw vseed.getRuntime().newTypeError(
                        String.format("failed to convert %s into Integer", vseed.getMetaClass()
                                .getName()));
View Full Code Here

Examples of org.vngx.jsch.algorithm.Random

    try {
      // Random instance for generating the kex cookie.  The 'cookie' MUST
      // be a random value generated by the sender. Its purpose is to make
      // it impossible for either side to fully determine the keys and the
      // session identifier.
      final Random random = AlgorithmManager.getManager().createAlgorithm(Algorithms.RANDOM, _session);

      // Construct the KEX INIT message packet
      // byte    SSH_MSG_KEXINIT(20)
      // byte[16]  cookie (random bytes)
      // string  kex_algorithms
      // string  server_host_key_algorithms
      // string  encryption_algorithms_client_to_server
      // string  encryption_algorithms_server_to_client
      // string  mac_algorithms_client_to_server
      // string  mac_algorithms_server_to_client
      // string  compression_algorithms_client_to_server
      // string  compression_algorithms_server_to_client
      // string  languages_client_to_server
      // string  languages_server_to_client
      // byte    boolean first_kex_packet_follows
      // uint32  0 (reserved for future extension)
      kexPacket.reset();
      kexBuffer.putByte(SSH_MSG_KEXINIT);
      random.fill(kexBuffer.getArray(), kexBuffer.getIndex(), KEX_COOKIE_LENGTH);
      kexBuffer.skip(KEX_COOKIE_LENGTH)// Move index forward
      kexBuffer.putString(_session.getConfig().getString(SessionConfig.KEX_ALGORITHMS));
      kexBuffer.putString(_session.getConfig().getString(SessionConfig.KEX_SERVER_HOST_KEY));
      kexBuffer.putString(_session.getConfig().getCiphersC2S())// Checked list of client-to-server ciphers
      kexBuffer.putString(_session.getConfig().getCiphersS2C())// Checked list of server-to-client ciphers
View Full Code Here

Examples of weka.core.Debug.Random

    NumericToNominal filter = new NumericToNominal();
    filter.setInputFormat(instances);
    instances = Filter.useFilter(instances, filter);
   
   
    Random ran = new Random(System.currentTimeMillis());
    instances.randomize(ran);
   
    int max = 20;
    double[] acc = new double[max];
    while(max > 0) {
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.