code: public static String createHash(char[] password) throws NoSuchAlgorithmException, InvalidKeySpecException {
  
      final SecureRandom random = new SecureRandom();
      final byte[] salt = new byte[SALT_BYTES];
      random.nextBytes(salt);
  
      final byte[] hash = pbkdf2(password, salt, PBKDF2_ITERATIONS, HASH_BYTES);
      // format iterations:salt:hash
      return PBKDF2_ITERATIONS + ":" + toHex(salt) + ":" + toHex(hash);
    }
docs: Returns a salted PBKDF2 hash of the password in the format &lt;iterations&gt;:&lt;salt&gt;:&lt;hash&gt;
  
  @param password
  the password to hash
  
  @return a salted PBKDF2 hash of the password