гавно код, работает вводите пароль он дает хеш в консоль вызываете функцию keys() вводите хеш получаете пароль хеши всегда разные(рандом) function hesh(){ const jst = ['X','E','G','-','A','y','$','B', 'L', 'Q','#']; const hesh66 = Math.floor(Math.random() * 9);const hesh01 = Math.floor(Math.random() * 9); const hesh11 = Math.floor(Math.random() * jst.length);const hesh12 = Math.floor(Math.random() * jst.length); const hesh13 = Math.floor(Math.random() * jst.length);const hesh14 = Math.floor(Math.random() * jst.length); const hesh15 = Math.floor(Math.random() * jst.length);const hesh16 = Math.floor(Math.random() * jst.length); const hesh02 = Math.floor(Math.random() * 9);const hesh03 = Math.floor(Math.random() * 9);const hesh04 = Math.floor(Math.random() * 9);const hesh05 = Math.floor(Math.random() * 9); const hesh06 = Math.floor(Math.random() * 9);const hesh07 = Math.floor(Math.random() * 9);const hesh08 = Math.floor(Math.random() * 9); this.hesh99 = jst[hesh11] + jst[hesh13] + hesh66 + jst[hesh16] + hesh66 + jst[hesh15] + hesh01 + hesh04 + hesh05 + hesh06 + jst[hesh12] + hesh03 + jst[hesh11] + hesh07 + hesh08; var pawr = prompt('ваш password'); this.OPW = pawr; pawr = this.hesh99;console.log(`ваш хеш: ${pawr}`); alert(`ваш хеш: ${pawr}`); } const opwe = new hesh(); function keys(){ var OW2 = prompt('you hesh:'); if (OW2 == opwe.hesh99){ alert(`you pass: ${opwe.OPW}`);console.log(`you pass: ${opwe.OPW}`); } } JS function hesh(){ const jst = ['X','E','G','-','A','y','$','B', 'L', 'Q','#']; const hesh66 = Math.floor(Math.random() * 9);const hesh01 = Math.floor(Math.random() * 9); const hesh11 = Math.floor(Math.random() * jst.length);const hesh12 = Math.floor(Math.random() * jst.length); const hesh13 = Math.floor(Math.random() * jst.length);const hesh14 = Math.floor(Math.random() * jst.length); const hesh15 = Math.floor(Math.random() * jst.length);const hesh16 = Math.floor(Math.random() * jst.length); const hesh02 = Math.floor(Math.random() * 9);const hesh03 = Math.floor(Math.random() * 9);const hesh04 = Math.floor(Math.random() * 9);const hesh05 = Math.floor(Math.random() * 9); const hesh06 = Math.floor(Math.random() * 9);const hesh07 = Math.floor(Math.random() * 9);const hesh08 = Math.floor(Math.random() * 9); this.hesh99 = jst[hesh11] + jst[hesh13] + hesh66 + jst[hesh16] + hesh66 + jst[hesh15] + hesh01 + hesh04 + hesh05 + hesh06 + jst[hesh12] + hesh03 + jst[hesh11] + hesh07 + hesh08; var pawr = prompt('ваш password'); this.OPW = pawr; pawr = this.hesh99;console.log(`ваш хеш: ${pawr}`); alert(`ваш хеш: ${pawr}`); } const opwe = new hesh(); function keys(){ var OW2 = prompt('you hesh:'); if (OW2 == opwe.hesh99){ alert(`you pass: ${opwe.OPW}`);console.log(`you pass: ${opwe.OPW}`); } }