Skip to content

Commit 576df69

Browse files
committed
Merge branch 'main' of github.com:erfanium/crypto-random-string into main
2 parents 9b61040 + b16acae commit 576df69

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

README.md

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Deno module based on [crypto-random-string](https://github.com/sindresorhus/cryp
77
## Import Module
88

99
```typescript
10-
import { cryptoRandomString, cryptoRandomStringAsync } from "https://deno.land/x/crypto_random_string@1.0.0/mod.ts"
10+
import { cryptoRandomString } from "https://deno.land/x/crypto_random_string@1.0.0/mod.ts"
1111
// or
12-
import { cryptoRandomString, cryptoRandomStringAsync } from "https://github.com/piyush-bhatt/crypto-random-string/raw/main/mod.ts"
12+
import { cryptoRandomString } from "https://github.com/piyush-bhatt/crypto-random-string/raw/main/mod.ts"
1313
```
1414

1515
## Usage
@@ -21,36 +21,20 @@ import { cryptoRandomString, cryptoRandomStringAsync } from "https://github.com/
2121

2222
cryptoRandomString({length: 10}); // '0696cb9e70'
2323

24-
await cryptoRandomStringAsync({length: 10}); // 'c8d4b0140d'
25-
2624
cryptoRandomString({length: 10, type: 'base64'}); // 'dw3mgWC5uO'
2725

28-
await cryptoRandomStringAsync({length: 10, type: 'base64'}); // 'k6ALljZx+E'
29-
3026
cryptoRandomString({length: 10, type: 'url-safe'}); // '0pN1Y2Jz.X'
3127

32-
await cryptoRandomStringAsync({length: 10, type: 'url-safe'}); // '7.F5oBY9Qy'
33-
3428
cryptoRandomString({length: 10, type: 'numeric'}); // '1639380067'
3529

36-
await cryptoRandomStringAsync({length: 10, type: 'numeric'}); // '0923903115'
37-
3830
cryptoRandomString({length: 6, type: 'distinguishable'}); // 'H4HH5D'
3931

40-
await cryptoRandomStringAsync({length: 6, type: 'distinguishable'}); // 'D2Y254'
41-
4232
cryptoRandomString({length: 10, type: 'ascii-printable'}); // '#I&J.GP./9'
4333

44-
await cryptoRandomStringAsync({length: 10, type: 'ascii-printable'}); // '7t%FxZkyL('
45-
4634
cryptoRandomString({length: 10, type: 'alphanumeric'}); // 'ZtgC2J6aU5'
4735

48-
await cryptoRandomStringAsync({length: 10, type: 'alphanumeric'}); // 'FELQVN9S8H'
49-
5036
cryptoRandomString({length: 10, characters: 'abc'}); // 'abcabccbcc'
5137

52-
await cryptoRandomStringAsync({length: 10, characters: 'abc'}); // 'abcbbbacbb'
53-
5438
```
5539

5640
## API
@@ -59,9 +43,6 @@ await cryptoRandomStringAsync({length: 10, characters: 'abc'}); // 'abcbbbacbb'
5943

6044
Returns a randomized string. [Hex](https://en.wikipedia.org/wiki/Hexadecimal) by default.
6145

62-
### cryptoRandomStringAsync(options)
63-
64-
Returns a promise which resolves to a randomized string. [Hex](https://en.wikipedia.org/wiki/Hexadecimal) by default.
6546

6647
#### options
6748

cryptoRandomString.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ function randomBytes(size: number) {
4343
crypto.getRandomValues(bytes);
4444
}
4545

46-
console.log(bytes);
4746
return bytes;
4847
}
4948

0 commit comments

Comments
 (0)