UNPKG
@e280/authlocal
Version:
latest (0.2.0-39)
0.2.0-39
0.2.0-38
0.2.0-37
0.2.0-36
0.2.0-35
0.2.0-34
0.2.0-33
0.2.0-32
0.2.0-31
0.2.0-30
0.2.0-29
0.2.0-28
0.2.0-27
0.2.0-26
0.2.0-25
0.2.0-24
0.2.0-23
0.2.0-22
0.2.0-21
0.2.0-20
0.2.0-19
User-sovereign login system for everybody
github.com/e280/authlocal
e280/authlocal
@e280/authlocal
/
s
/
tools
/
random-digits.ts
12 lines
(9 loc)
•
261 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
export
function
randomDigits
(
count
:
number
) {
const
digits = [...
"1234567890"
]
const
array
:
string
[] = []
for
(
const
_
of
Array
(count)) {
const
index =
Math
.
floor
(
Math
.
random
() * digits.
length
) array.
push
(digits.
at
(index)!) }
return
array.
join
(
""
) }