moduleHappstack.Crypto.HMACwhereimportHappstack.Crypto.SHA1importHappstack.Crypto.Base64importData.BitsimportData.CharhmacSHA1::String->String->StringhmacSHA1keystr|lengthkey>b=fail"hmacSHA1 doesn't support large keys yet"|otherwise=encode$sha1Raw(doxorkeyopad++sha1Raw(doxorkeyipad++str))whereb=64opad=replicateb'\x5C'ipad=replicateb'\x36'doxora=zipWithfn(a++repeat'\0')fnxy=chr(ordx`xor`ordy)