Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tech
pi_math
Commits
d7031c8a
Commit
d7031c8a
authored
8 months ago
by
余强
Browse files
Options
Download
Email Patches
Plain Diff
fix: 暂时删除cryptoRandomInt导出(后端会奔溃)
parent
05bdf417
main
v1.0.14
v1.0.13
v1.0.12
v1.0.11
v1.0.10
v1.0.9
v1.0.8
v1.0.7
v1.0.6
v1.0.5
v1.0.4
v1.0.3
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/math.ts
+9
-9
src/math.ts
with
9 additions
and
9 deletions
+9
-9
src/math.ts
+
9
-
9
View file @
d7031c8a
...
...
@@ -121,15 +121,15 @@ export const randomInt = (v1: number, v2: number): number => {
* @example
*
*/
export
const
cryptoRandomInt
=
():
number
=>
{
if
(
crypto
)
{
crypto
.
getRandomValues
(
cryptoCache
);
//
export const cryptoRandomInt = (): number => {
//
if (crypto) {
//
crypto.getRandomValues(cryptoCache);
return
cryptoCache
[
0
];
}
else
{
return
Math
.
floor
(
Math
.
random
()
*
0xffffffff
);
}
};
//
return cryptoCache[0];
//
} else {
//
return Math.floor(Math.random() * 0xffffffff);
//
}
//
};
/**
* @description 获得一组安全的随机32位整数
...
...
@@ -322,4 +322,4 @@ export const equal = (num1: number, num2: number) => {
const
facCache
=
[
0
,
1
,
2
];
// 单个安全的随机32位整数的计算缓冲
const
cryptoCache
=
new
Uint32Array
(
1
);
//
const cryptoCache = new Uint32Array(1);
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help