crypt-5ea4a8e1.js 1.3 KB

1
  1. var a={exports:{}};(function(){var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u={rotl:function(r,t){return r<<t|r>>>32-t},rotr:function(r,t){return r<<32-t|r>>>t},endian:function(r){if(r.constructor==Number)return u.rotl(r,8)&16711935|u.rotl(r,24)&4278255360;for(var t=0;t<r.length;t++)r[t]=u.endian(r[t]);return r},randomBytes:function(r){for(var t=[];r>0;r--)t.push(Math.floor(Math.random()*256));return t},bytesToWords:function(r){for(var t=[],n=0,o=0;n<r.length;n++,o+=8)t[o>>>5]|=r[n]<<24-o%32;return t},wordsToBytes:function(r){for(var t=[],n=0;n<r.length*32;n+=8)t.push(r[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(r){for(var t=[],n=0;n<r.length;n++)t.push((r[n]>>>4).toString(16)),t.push((r[n]&15).toString(16));return t.join("")},hexToBytes:function(r){for(var t=[],n=0;n<r.length;n+=2)t.push(parseInt(r.substr(n,2),16));return t},bytesToBase64:function(r){for(var t=[],n=0;n<r.length;n+=3)for(var o=r[n]<<16|r[n+1]<<8|r[n+2],e=0;e<4;e++)n*8+e*6<=r.length*8?t.push(f.charAt(o>>>6*(3-e)&63)):t.push("=");return t.join("")},base64ToBytes:function(r){r=r.replace(/[^A-Z0-9+\/]/ig,"");for(var t=[],n=0,o=0;n<r.length;o=++n%4)o!=0&&t.push((f.indexOf(r.charAt(n-1))&Math.pow(2,-2*o+8)-1)<<o*2|f.indexOf(r.charAt(n))>>>6-o*2);return t}};a.exports=u})();var c=a.exports;export{c};