UNPKG
@matatbread/typia
Version:
latest (9.7.2-nrc)
9.7.2-nrc
7.0.1-nrc
6.11.1
6.11.0
6.11.0-p1
6.8.0
Superfast runtime validators with only one line
typia.io
samchon/typia
@matatbread/typia
/
src
/
internal
/
_randomFormatUuid.ts
7 lines
(6 loc)
•
234 B
text/typescript
View Raw
1
2
3
4
5
6
7
export
const
_randomFormatUuid = ():
string
=>
"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
.
replace
(
/[xy]/g
,
(
c
) =>
{
const
r = (
Math
.
random
() *
16
) |
0
;
const
v = c ===
"x"
? r : (r &
0x3
) |
0x8
;
return
v.
toString
(
16
); });