CryptoJS SHA256
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/rollups/sha256.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.2/components/enc-base64-min.js"></script> <script> function formSubmit(form) { //document.write("input: "+form.password.value+"<br>"); var hash = CryptoJS.SHA256(form.password.value); var base64 = CryptoJS.enc.Base64.stringify(hash).replace('=',''); form.password.value = base64; //document.write("hash: "+hash+"<br>"); //document.write("base64: "+base64+"<br>"); form.submit(); } </script> |