Skip to content

Commit

Permalink
Change example and update definitions (#453)
Browse files Browse the repository at this point in the history
Added which random characters it uses. 
Added default for optional parameter rand.

Changed example, removed xmur3 entirely for the sake of simplicity.
  • Loading branch information
ghambhackmud authored May 8, 2024
1 parent 0af7100 commit c07ceb3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions docs/scripting/scripts.lib/create_rand_string.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: .create_rand_string()
---

A function that generates a string of random characters.
A function that generates a string of random lowercase alphanumeric characters.

## Syntax

Expand All @@ -18,7 +18,7 @@ The number of characters that the random string should contain.

#### rand (optional)

A random number generator function.
A random number generator function. Defaults to Math.random.

### Return

Expand All @@ -29,8 +29,7 @@ Returns a string.
```js
function(context, args) {
const l = #fs.scripts.lib();
const rand = l.xmur3("seed");

return l.create_rand_string(7, rand);
return l.create_rand_string(7);
}
```

0 comments on commit c07ceb3

Please sign in to comment.