!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(n="undefined"!=typeof globalThis?globalThis:n||self).jsSHA=e()}(this,function(){"use strict";var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e="ARRAYBUFFER not supported by this environment",t="UINT8ARRAY not supported by this environment";function i(n,e,t,r){for(var i,o,u=e||[0],s=(t=t||0)>>>3,h=-1===r?3:0,a=0;a>>2,u.length<=i&&u.push(0),u[i]|=n[a]<<8*(h+r*(o%4));return{value:u,binLen:8*n.length+t}}function o(n,M,I){switch(M){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(n){case"HEX":return function(n,e,t){var r,i,o,u=n,n=e,e=t,s=I;if(0!=u.length%2)throw new Error("String of HEX type must be in byte increments");for(var h=n||[0],a=(e=e||0)>>>3,w=-1===s?3:0,f=0;f>>1)+a)>>>2;h.length<=i;)h.push(0);h[i]|=r<<8*(w+s*(o%4))}return{value:h,binLen:4*u.length+e}};case"TEXT":return function(n,e,t){var r,i,o,u,s,h,a,w,f=n,n=M,c=0,l=I,p=0,v=e||[0],A=(c=t||0)>>>3;if("UTF8"===n)for(a=-1===l?3:0,o=0;o>>6),i.push(128|63&r)):r<55296||57344<=r?i.push(224|r>>>12,128|r>>>6&63,128|63&r):(r=65536+((1023&r)<<10|1023&f.charCodeAt(o+=1)),i.push(240|r>>>18,128|r>>>12&63,128|r>>>6&63,128|63&r)),u=0;u>>2;v.length<=s;)v.push(0);v[s]|=i[u]<<8*(a+l*(h%4)),p+=1}else for(a=-1===l?2:0,w="UTF16LE"===n&&1!==l||"UTF16LE"!==n&&1===l,o=0;o>>8),s=(h=p+A)>>>2;v.length<=s;)v.push(0);v[s]|=r<<8*(a+l*(h%4)),p+=2}return{value:v,binLen:8*p+c}};case"B64":return function(n,e,t){var r,i,o,u,s,h,a=n,n=0,w=I,f=0,c=e||[0],l=(n=t||0)>>>3,p=-1===w?3:0,e=a.indexOf("=");if(-1===a.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(a=a.replace(/=/g,""),-1!==e&&e