Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Random String Generator

33 sites Security covered Drupal 10–11
View on drupal.org

This module provides a service to generate random strings, words, and numbers programmatically. It offers various methods for different types of random generation, which can be used in custom code, routes, and JavaScript.

CONTENTS OF THIS FILE
---------------------

* Introduction
* Installation
* Maintainers

INTRODUCTION
------------

Random String Generator module allows the developer to randomly generate
the string or a word or a number that will allows the user to use those
randomly generated key.

* For a full description of the module, visit the project page:
https://www.drupal.org/project/rsg

* To submit bug reports and feature suggestions, or to track changes:
https://www.drupal.org/project/issues/search/rsg

INSTALLATION
------------

* Install as you would normally install a contributed Drupal module.
See https://www.drupal.org/node/895232 for further information.

* By Using composer, composer require "drupal/rsg"

USAGE
-----------

* There will be as a service that will be helpful to generate
the string as below.
- \Drupal::service('random.string.generator')->string(10);
- \Drupal::service('random.string.generator')->word(10);
- \Drupal::service('random.string.generator')->number(10);

* This will be used in routes that will help to generate the random content
- /random/string/10
- /random/word/10
- /random/word-small/10
- /random/word-small-numeric/10
- /random/word-capital/10
- /random/word-capital-numeric/10
- /random/name/10/username
- /random/number/10
- /random/generate/10/pattern

* This will be used in JS to generate and use the strings.
- Drupal.generateString(10)
- Drupal.generateWord(10)
- Drupal.generateWordSmall(10)
- Drupal.generateWordSmallNumeric(10)
- Drupal.generateWordCapital(10)
- Drupal.generateWordCapitalNumeric(10)
- Drupal.generateName(10, 'username')
- Drupal.generateNumber(10)
- Drupal.generateRandom(10, 'patterns')

MAINTAINERS
-----------

Current maintainers:
* Praveen Achanta (praveen3555) - https://www.drupal.org/u/praveen3555

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Nov 2025
Latest release
1 month ago
Releases (12 mo)
2 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
2.0.0 Stable 10–11 Jul 12, 2026
1.0.2 Stable 8–11 Nov 14, 2025