Skip to content

Commit 8a98f25

Browse files
Update readme
1 parent 71d5545 commit 8a98f25

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
[![Tests](https://img.shields.io/github/actions/workflow/status/stfndamjanovic/php-random-string/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/stfndamjanovic/php-random-string/actions/workflows/run-tests.yml)
44

5-
Description
5+
This package can be used to generate a random string based on your set of characters or predefined ones.
6+
You can configure string length, prefix, suffix, count of strings, or to skip some strings under certain conditions...
67

78
## Installation
89

@@ -30,30 +31,30 @@ $string = RandomString::new(6)->generate(); // Output: dzGcot
3031

3132
### Predefined charset
3233

33-
If you want to generate string consist of numbers only, you can do it like this:
34+
If you want to generate string consist of numbers only, lower case letters or uppercase letters you can use predefined charsets.
3435
```php
3536
// Generate string that contains only numbers
3637
$config = StringConfig::make()
3738
->numbersOnly();
3839

39-
$string = RandomString::fromConfig($config)->generate(); // Output: 649432
40+
$string = RandomString::fromConfig($config)->generate(); // Output: 9387406871490781
4041

4142
// Generate string that contains only lower case letters
4243
$config = StringConfig::make()
4344
->lowerCaseOnly();
4445

45-
$string = RandomString::fromConfig($config)->generate(); // Output: 649432
46+
$string = RandomString::fromConfig($config)->generate(); // Output: hvphyfmgnvbbajve
4647

4748
// Generate string that contains only upper case letters
4849
$config = StringConfig::make()
4950
->upperCaseOnly();
5051

51-
$string = RandomString::fromConfig($config)->generate();
52+
$string = RandomString::fromConfig($config)->generate(); // Output: ZIVSUDQHAMDNQAYV
5253
```
5354

5455
### Custom charset
5556

56-
Or you can use your custom charset for generating random string
57+
Or you can use your custom charset for generating random string.
5758

5859
```php
5960
$config = StringConfig::make()
@@ -95,7 +96,7 @@ $string = RandomString::fromConfig($config)->generate(); // Output: PRE_rkM7Jl_A
9596

9697
### Array of random strings
9798

98-
RandomString can generate more than just one random string.
99+
RandomString can generate more than just one string.
99100

100101
```php
101102
$config = StringConfig::make()
@@ -109,7 +110,7 @@ $strings = RandomString::fromConfig($config)->generate();
109110

110111
### Uniqueness
111112

112-
By default, it may happen (rarely, but it's possible) to have not unique strings in the generated array. If you want to avoid it, just change the config.
113+
It may happen (rarely, but it's possible) to have not unique strings in the generated array. If you want to avoid it, just change the config.
113114

114115
```php
115116
$config = StringConfig::make()

0 commit comments

Comments
 (0)