Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/jev.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ for (const w of ['*Kq9zPm2x*', 'Senha123*', '*kQzXbTpwRm*', '_Ab3$xYz_']) {

(async () => {
// --- masking ---------------------------------------------------------------
const pw = r(6, 'abcdefghij') + r(3, '0123456789');
const pw = 'g' + r(5, 'abcdefghij') + r(3, '0123456789'); // 'g' fora do hex: só letras a-f e dígitos viram prefixo de hash e não são candidatos
const k = r(28);
const text = `a senha do banco é ${pw} e o token do painel é ${k}`;
const m = mask(text);
Expand Down
2 changes: 1 addition & 1 deletion test/whole-value.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const without = (bad) => [...PRINTABLE].filter((c) => !bad.includes(c)).join('')
// by shape alone those are never asked about; a label still captures them.
// Anywhere, a value that is wholly `$NAME` reads as a variable, not a password.
const FIELD = (v) => !/^["'`]/.test(v) && !/^\$\{?[A-Za-z_][A-Za-z0-9_]*\}?$/.test(v);
const PROSE = (v) => FIELD(v) && !/^(?:(?:~|\.{1,2})\/[\w@+.-]*|\/[\w@+.-]+\/[\w@+.-]+)(?:\/[\w@+.-]+)*\/?$/.test(v) && !/[.,;:?"'`)\]}>]$/.test(v) && !/^[([{<:=]/.test(v) && !/^[)\]}>]/.test(v) && !commonForm(v);
const PROSE = (v) => FIELD(v) && !/^(?:(?:~|\.{1,2})\/[\w@+.-]*|\/[\w@+.-]+\/[\w@+.-]+)(?:\/[\w@+.-]+)*\/?$/.test(v) && !/[.,;:?!"'`)\]}>]$/.test(v) && !/^[([{<:=]/.test(v) && !/^[)\]}>]/.test(v) && !commonForm(v);
const LAYOUTS = [
['label', '', FIELD, (v) => `Senha: ${v}`],
['login + label', '', FIELD, (v) => `Usuário: joao.silva\nSenha: ${v}`],
Expand Down
Loading