Android Random Byte Array getRandomBytes(final int size)

Here you can find the source of getRandomBytes(final int size)

Description

get Random Bytes

Declaration

static byte[] getRandomBytes(final int size) 

Method Source Code

//package com.java2s;

import java.security.SecureRandom;

public class Main {
    static byte[] getRandomBytes(final int size) {
        final SecureRandom random = new SecureRandom();
        final byte[] bytes = new byte[size];
        random.nextBytes(bytes);/*from ww  w. j av  a 2 s. c  om*/
        return bytes;
    }
}

Related

  1. randomInt(int min, int max)
  2. randomStr(int length)
  3. randomStr(int length)
  4. generateSalt()
  5. generateSalt()