You need to include the file located in this github repository to define the Class function.
https://github.com/Arrowgroup/JSDigestAuth/blob/master/src/main/webapp/resources/js/jquery.class.min.js
In fact looking at the example there, you will need all this in your header, if you don't have these script files in this order then you will get undeclared errors as you have seen in BOTH your questions.
As an aside, a quick glance at this code shown it to be... well... let's just say "not so good." As an example maybe it can be helpful but I saw many things which were not leading practices.
<script type="text/javascript" src="jquery.min.js" ></script>
<script type="text/javascript" src="jquery.class.min.js" ></script>
<script type="text/javascript" src="md5-min.js" ></script>
<script type="text/javascript" src="digest-auth.js" ></script>
<script type="text/javascript">
var digestAuth = new pl.arrowgroup.DigestAuthentication(
{
onSuccess : function(response){
$("#response").html(response);
},
onFailure : function(response){
$("#response").html('Invalid credentials !!!');
},
cnonce : 'testCnonce'
}
);
function callREST(){
digestAuth.setCredentials($('#user').val(),$('#password').val());
digestAuth.call('/restauth/user/echo');
}
</script>
$.Class?$.Class?jquery.jsfile? Is it another jquery plugin?