I'm new to java script, I'm using a code I found in a website to implement SHA1 hashing
<link href="css/style.css" rel="stylesheet">
<!--newcode -->
<script src="js/sha1.js">/* SHA-256 JavaScript implementation */</script>
<script>
$(document).ready(function() {
// hash listener
$('#generate-hash').click( function() {
var t = new Date();
hash = Sha1.hash($('#message').val());
$('#hash-time').html(((new Date() - t))+'ms');
$('#hash').val(hash);
});
// show source code
$.get('js/crypto/sha1.js', function(data) {
var src = data.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>') // replace &, <, >
$('#src-code').html(src);
prettyPrint();
}, 'text');
});
</script>
the chrome console points at line 22:
$(document).ready(function() {
Uncaught ReferenceError: `$` is not defined