How to use the argon2.default.replace function in argon2

To help you get started, we’ve selected a few argon2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github keeweb / keeweb / app / scripts / util / kdbxweb / kdbxweb-init.js View on Github external
wasmBinaryBase64 +
                        '"), c => c.charCodeAt(0)),' +
                        'print(...args) { postMessage({op:"log",args}) },' +
                        'printErr(...args) { postMessage({op:"log",args}) },' +
                        'postRun:' +
                        this.workerPostRun.toString() +
                        ',' +
                        'calcHash:' +
                        this.calcHash.toString() +
                        ',' +
                        'wasmMemory:wasmMemory,' +
                        'buffer:wasmMemory.buffer,' +
                        'TOTAL_MEMORY:' +
                        initialMemory * WASM_PAGE_SIZE +
                        '}';
                    const script = argon2LoaderCode.replace(
                        /^var Module.*?}/,
                        memoryDecl + moduleDecl
                    );
                    const blob = new Blob([script], { type: 'application/javascript' });
                    const objectUrl = URL.createObjectURL(blob);
                    const worker = new Worker(objectUrl);
                    const onMessage = e => {
                        switch (e.data.op) {
                            case 'log':
                                logger.debug(...e.data.args);
                                break;
                            case 'postRun':
                                logger.debug(
                                    'WebAssembly runtime loaded (web worker)',
                                    logger.ts(ts)
                                );