# How do I use the encryption (secure) random method?

**URL:** <https://discourse.processing.org/t/how-do-i-use-the-encryption-secure-random-method/23728>\
**Category:** Coding Questions\
**Created:** [September 7, 2020, 10:05pm UTC](https://discourse.processing.org/t/how-do-i-use-the-encryption-secure-random-method/23728 "2020-09-07T22:05:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AntiViral\_Builder](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@AntiViral\_Builder](https://discourse.processing.org/u/AntiViral_Builder)\
**Post date:** [September 7, 2020, 10:05pm UTC](https://discourse.processing.org/t/how-do-i-use-the-encryption-secure-random-method/23728/1 "2020-09-07T22:05:13Z")

</div>

So I would just like to know how to generate arrays with a size and number range.

---

<div class="post-metadata">

**Author:** ![yanze03](https://avatars.discourse-cdn.com/v4/letter/y/e9a140/32.png) [@yanze03](https://discourse.processing.org/u/yanze03)\
**Post date:** [September 15, 2020, 6:17pm UTC](https://discourse.processing.org/t/how-do-i-use-the-encryption-secure-random-method/23728/2 "2020-09-15T18:17:01Z")

</div>

the function random is this:

```auto
random();

```

if you want for example to fill a square with a random color you can paste it inside a function:

```auto
fill(random(255));

```

or:

```auto
fill(random(255),random(255),random(255));

```

I wrote 255 because those are rgb colors. it will pick anynumber from 0 to 255. it is a float method so there are numbers behind the komma. if you want to convert it to an int you have to do some math.  
You can also pick a random number between lets say 10 and 100:

```auto
random(10,100);

```

you can also store the number in variables:

```auto
float a = random(1,8);

```

hope this helped you understand the function better 🙂
