File tree 2 files changed +15
-10
lines changed
libs/common/src/platform/services
2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ export class WebCryptoFunctionService implements CryptoFunctionService {
69
69
hashLen : 32 ,
70
70
type : argon2 . ArgonType . Argon2id ,
71
71
} ) ;
72
+ argon2 . unloadRuntime ( ) ;
72
73
return result . hash ;
73
74
}
74
75
Original file line number Diff line number Diff line change 1
1
diff --git a/node_modules/argon2-browser/lib/argon2.js b/node_modules/argon2-browser/lib/argon2.js
2
- index ffa77a5..b498e2d 100644
2
+ index ffa77a5..98b2f13 100644
3
3
--- a/node_modules/argon2-browser/lib/argon2.js
4
4
+++ b/node_modules/argon2-browser/lib/argon2.js
5
5
@@ -78,16 +78,27 @@
@@ -36,10 +36,16 @@ index ffa77a5..b498e2d 100644
36
36
return fetch(wasmPath)
37
37
.then((response) => response.arrayBuffer())
38
38
.then((ab) => new Uint8Array(ab));
39
- @@ -354,6 +365,24 @@
40
- }
41
- }
42
-
39
+ @@ -351,7 +362,28 @@
40
+ loadModule._module.unloadRuntime();
41
+ delete loadModule._promise;
42
+ delete loadModule._module;
43
+ + if (typeof require !== 'undefined') {
44
+ + delete require.cache[require.resolve('../dist/argon2.js')]
45
+ + }
46
+ + }
47
+ + }
48
+ +
43
49
+ // ref: https://stackoverflow.com/a/47880734/1090359
44
50
+ // ref: https://github.com/GoogleChromeLabs/wasm-feature-detect/blob/main/src/detectors/simd/module.wat (translated with wat2wasm)
45
51
+ function checkIfSIMDSupported() {
@@ -54,10 +60,8 @@ index ffa77a5..b498e2d 100644
54
60
+ }
55
61
+ } catch {
56
62
+ return false;
57
- + }
63
+ }
58
64
+ return false;
59
- + }
60
- +
65
+ }
66
+
61
67
return {
62
- ArgonType,
63
- hash: argon2Hash,
You can’t perform that action at this time.
0 commit comments