use crypto if available
This commit is contained in:
parent
2863763a27
commit
6ca1f5c431
|
@ -21,7 +21,9 @@
|
||||||
if (secret) {
|
if (secret) {
|
||||||
secret = undefined;
|
secret = undefined;
|
||||||
} else {
|
} else {
|
||||||
secret = CommonHelper.randomString(50);
|
secret = crypto?.randomUUID
|
||||||
|
? crypto.randomUUID() + CommonHelper.randomString(14)
|
||||||
|
: CommonHelper.randomString(50);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
@ -419,7 +419,7 @@ export default class CommonHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates random string (suitable for elements id and keys).
|
* Generates pseudo-random string (suitable for elements id and keys).
|
||||||
*
|
*
|
||||||
* @param {Number} [length] Results string length (default 10)
|
* @param {Number} [length] Results string length (default 10)
|
||||||
* @return {String}
|
* @return {String}
|
||||||
|
|
Loading…
Reference in New Issue