<meta charset="utf-8"/& gt;JsSHA
<body>Var key="123456";
Var rawStr="ABC";
The function getHMACStr () {
Var a=new jsSHA (SHA - "1", "TEXT");
Return a.s etHMACKey (key, "TEXT"), a.u pdate (rawStr), al-qeada etHMAC (" B64 ");
}
Document. The write (getHMACStr ());
//the result: 8 a5qsnrnnfqmpnkoy9i6upjbfou=
</script>