/* * This file is part of the TYPO3 CMS project. * * It is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License, either version 2 * of the License, or any later version. * * For the full copyright and license information, please read the * LICENSE.txt file that was distributed with this source code. * * The TYPO3 project - inspiring people to share! */ /*! Based on http://www.webtoolkit.info/javascript_md5.html */class n{static hash(S){let t,s,c,a,C,e,r,F,o;S=n.utf8Encode(S);const x=n.convertToWordArray(S);for(e=1732584193,r=4023233417,F=2562383102,o=271733878,t=0;t>>32-t}static addUnsigned(S,t){const s=S&2147483648,c=t&2147483648,a=S&1073741824,C=t&1073741824,e=(S&1073741823)+(t&1073741823);return a&C?e^2147483648^s^c:a|C?e&1073741824?e^3221225472^s^c:e^1073741824^s^c:e^s^c}static F(S,t,s){return S&t|~S&s}static G(S,t,s){return S&s|t&~s}static H(S,t,s){return S^t^s}static I(S,t,s){return t^(S|~s)}static FF(S,t,s,c,a,C,e){return S=n.addUnsigned(S,n.addUnsigned(n.addUnsigned(n.F(t,s,c),a),e)),n.addUnsigned(n.rotateLeft(S,C),t)}static GG(S,t,s,c,a,C,e){return S=n.addUnsigned(S,n.addUnsigned(n.addUnsigned(n.G(t,s,c),a),e)),n.addUnsigned(n.rotateLeft(S,C),t)}static HH(S,t,s,c,a,C,e){return S=n.addUnsigned(S,n.addUnsigned(n.addUnsigned(n.H(t,s,c),a),e)),n.addUnsigned(n.rotateLeft(S,C),t)}static II(S,t,s,c,a,C,e){return S=n.addUnsigned(S,n.addUnsigned(n.addUnsigned(n.I(t,s,c),a),e)),n.addUnsigned(n.rotateLeft(S,C),t)}static convertToWordArray(S){let t;const s=S.length,c=s+8,C=((c-c%64)/64+1)*16,e=Array(C-1);let r=0,F=0;for(;F>>29,e}static wordToHex(S){let t="",s="",c,a;for(a=0;a<=3;a++)c=S>>>a*8&255,s="0"+c.toString(16),t=t+s.substr(s.length-2,2);return t}static utf8Encode(S){S=S.replace(/\r\n/g,` `);let t="";for(let s=0;s127&&c<2048?(t+=String.fromCharCode(c>>6|192),t+=String.fromCharCode(c&63|128)):(t+=String.fromCharCode(c>>12|224),t+=String.fromCharCode(c>>6&63|128),t+=String.fromCharCode(c&63|128))}return t}}export{n as default};