Skip to content

Commit 8b5014a

Browse files
committed
Meta tweaks
1 parent 1ebdf2e commit 8b5014a

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,20 @@
2727
"identifier",
2828
"slug",
2929
"salt",
30+
"pin",
3031
"crypto",
3132
"strong",
3233
"secure",
33-
"hex"
34+
"hex",
35+
"secret",
36+
"protect"
3437
],
3538
"dependencies": {
36-
"type-fest": "^0.5.2"
39+
"type-fest": "^0.8.1"
3740
},
3841
"devDependencies": {
3942
"ava": "^2.1.0",
40-
"tsd": "^0.7.3",
41-
"xo": "^0.24.0"
43+
"tsd": "^0.11.0",
44+
"xo": "^0.25.3"
4245
}
4346
}

readme.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22

33
> Generate a [cryptographically strong](https://en.wikipedia.org/wiki/Strong_cryptography) random string
44
5-
Can be useful for creating an identifier, slug, salt, fixture, etc.
6-
5+
Can be useful for creating an identifier, slug, salt, PIN code, fixture, etc.
76

87
## Install
98

109
```
1110
$ npm install crypto-random-string
1211
```
1312

14-
1513
## Usage
1614

1715
```js
@@ -33,7 +31,6 @@ cryptoRandomString({length: 10, characters: 'abc'});
3331
//=> 'abaaccabac'
3432
```
3533

36-
3734
## API
3835

3936
### cryptoRandomString(options)
@@ -46,32 +43,31 @@ Type: `object`
4643

4744
##### length
4845

49-
*Required*<br>
46+
*Required*\
5047
Type: `number`
5148

5249
Length of the returned string.
5350

5451
##### type
5552

56-
Type: `string`<br>
57-
Default: `'hex'`<br>
58-
Values: `'hex'` `'base64'` `'url-safe'` `'numeric'`
53+
Type: `string`\
54+
Default: `'hex'`\
55+
Values: `'hex' | 'base64' | 'url-safe' | 'numeric'`
5956

6057
Use only characters from a predefined set of allowed characters.
6158

6259
Cannot be set at the same time as the `characters` option.
6360

6461
##### characters
6562

66-
Type: `string`<br>
67-
Minimum length: `1`<br>
63+
Type: `string`\
64+
Minimum length: `1`\
6865
Maximum length: `65536`
6966

7067
Use only characters from a custom set of allowed characters.
7168

7269
Cannot be set at the same time as the `type` option.
7370

74-
7571
## Related
7672

7773
- [random-int](https://github.com/sindresorhus/random-int) - Generate a random integer
@@ -82,7 +78,6 @@ Cannot be set at the same time as the `type` option.
8278
- [random-obj-prop](https://github.com/sindresorhus/random-obj-prop) - Get a random property from an object
8379
- [unique-random](https://github.com/sindresorhus/unique-random) - Generate random numbers that are consecutively unique
8480

85-
8681
---
8782

8883
<div align="center">

0 commit comments

Comments
 (0)