https://github.com/corentinth/randing
Random string generator
https://github.com/corentinth/randing
es6-javascript generator javascript random string token
Last synced: 5 months ago
JSON representation
Random string generator
- Host: GitHub
- URL: https://github.com/corentinth/randing
- Owner: CorentinTh
- License: mit
- Created: 2019-02-07T09:34:16.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T01:43:20.000Z (over 3 years ago)
- Last Synced: 2025-08-19T16:08:38.403Z (10 months ago)
- Topics: es6-javascript, generator, javascript, random, string, token
- Language: JavaScript
- Homepage:
- Size: 873 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
-------
Random + String = Randing.
Easily generate configurable random string and token
## Installation
Easy installation using `yarn` or `npm`:
```bash
yarn add randing
# or
npm install randing --save
```
## Usage
```javascript
const randing = require('randing');
console.log(randing()); // UIVfjWVjN1UjyhMepVXPtcnVO9yi7uENJULhhbQMxpot2o2rP6
console.log(randing(10)); // ejcWWx3coe
console.log(randing(60, {
special:true,
uppercase:false, // n-*sh[]b@q?le
||p
### randing(length, [config]) ⇒ string
Generate a random string (token)
**Kind**: global function
**Returns**: string - - A random string of size length
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| length | number | 50 | Length (in character) of the returned string |
| [config] | object | | Configuration for the token generation |
| [config.lowercase] | boolean | true | Allow lowercase letters in the token |
| [config.uppercase] | boolean | true | Allow uppercase letters in the token |
| [config.figures] | boolean | true | Allow figures in the token |
| [config.special] | boolean | false | Allow special characters in the token |
| [config.alphabet] | string | | A string of characters to generate the random token from |
## Credit
Created by [Corentin Thomasset](corentin-thomasset.fr).