første xml update
[virt-orchestrator.git] / vFLOWER / content / Actions / com.vmware.pso.cryptojs / base64Encode.action.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <dunes-script-module name="base64Encode" result-type="string" api-version="3.1.0" id="c6c94b25-55fa-4d47-9d2b-97292fdcfe57" version="0.0.2" allowed-operations="fve">
3     <description>
4 Encodes a message with Base64
5
6 Pure Javascript and self contained.  Uses code.google.com/p/crypto-js version 3.1.2
7     </description>
8
9     <param n="input" t="string">Message to encode with Base64</param>
10
11     <script encoded="false">
12 /*
13 CryptoJS v3.1.2
14 code.google.com/p/crypto-js
15 (c) 2009-2013 by Jeff Mott. All rights reserved.
16 code.google.com/p/crypto-js/wiki/License
17 */
18 /* components/core-min.js */
19 var CryptoJS=CryptoJS||function(h,r){var k={},l=k.lib={},n=function(){},f=l.Base={extend:function(a){n.prototype=this;var b=new n;a&amp;&amp;b.mixIn(a);b.hasOwnProperty("init")||(b.init=function(){b.$super.init.apply(this,arguments)});b.init.prototype=b;b.$super=this;return b},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&amp;&amp;(this[b]=a[b]);a.hasOwnProperty("toString")&amp;&amp;(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},
20 j=l.WordArray=f.extend({init:function(a,b){a=this.words=a||[];this.sigBytes=b!=r?b:4*a.length},toString:function(a){return(a||s).stringify(this)},concat:function(a){var b=this.words,d=a.words,c=this.sigBytes;a=a.sigBytes;this.clamp();if(c%4)for(var e=0;e&lt;a;e++)b[c+e&gt;&gt;&gt;2]|=(d[e&gt;&gt;&gt;2]&gt;&gt;&gt;24-8*(e%4)&amp;255)&lt;&lt;24-8*((c+e)%4);else if(65535&lt;d.length)for(e=0;e&lt;a;e+=4)b[c+e&gt;&gt;&gt;2]=d[e&gt;&gt;&gt;2];else b.push.apply(b,d);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b&gt;&gt;&gt;2]&amp;=4294967295&lt;&lt;
21 32-8*(b%4);a.length=h.ceil(b/4)},clone:function(){var a=f.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],d=0;d&lt;a;d+=4)b.push(4294967296*h.random()|0);return new j.init(b,a)}}),m=k.enc={},s=m.Hex={stringify:function(a){var b=a.words;a=a.sigBytes;for(var d=[],c=0;c&lt;a;c++){var e=b[c&gt;&gt;&gt;2]&gt;&gt;&gt;24-8*(c%4)&amp;255;d.push((e&gt;&gt;&gt;4).toString(16));d.push((e&amp;15).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c&lt;b;c+=2)d[c&gt;&gt;&gt;3]|=parseInt(a.substr(c,
22 2),16)&lt;&lt;24-4*(c%8);return new j.init(d,b/2)}},p=m.Latin1={stringify:function(a){var b=a.words;a=a.sigBytes;for(var d=[],c=0;c&lt;a;c++)d.push(String.fromCharCode(b[c&gt;&gt;&gt;2]&gt;&gt;&gt;24-8*(c%4)&amp;255));return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c&lt;b;c++)d[c&gt;&gt;&gt;2]|=(a.charCodeAt(c)&amp;255)&lt;&lt;24-8*(c%4);return new j.init(d,b)}},t=m.Utf8={stringify:function(a){try{return decodeURIComponent(escape(p.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return p.parse(unescape(encodeURIComponent(a)))}},
23 q=l.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new j.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&amp;&amp;(a=t.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,d=b.words,c=b.sigBytes,e=this.blockSize,f=c/(4*e),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0);a=f*e;c=h.min(4*a,c);if(a){for(var g=0;g&lt;a;g+=e)this._doProcessBlock(d,g);g=d.splice(0,a);b.sigBytes-=c}return new j.init(g,c)},clone:function(){var a=f.clone.call(this);
24 a._data=this._data.clone();return a},_minBufferSize:0});l.Hasher=q.extend({cfg:f.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){q.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&amp;&amp;this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(b,d){return(new a.init(d)).finalize(b)}},_createHmacHelper:function(a){return function(b,d){return(new u.HMAC.init(a,
25 d)).finalize(b)}}});var u=k.algo={};return k}(Math);
26
27 /* components/enc-base64-min.js */
28 (function(){var h=CryptoJS,j=h.lib.WordArray;h.enc.Base64={stringify:function(b){var e=b.words,f=b.sigBytes,c=this._map;b.clamp();b=[];for(var a=0;a&lt;f;a+=3)for(var d=(e[a&gt;&gt;&gt;2]&gt;&gt;&gt;24-8*(a%4)&amp;255)&lt;&lt;16|(e[a+1&gt;&gt;&gt;2]&gt;&gt;&gt;24-8*((a+1)%4)&amp;255)&lt;&lt;8|e[a+2&gt;&gt;&gt;2]&gt;&gt;&gt;24-8*((a+2)%4)&amp;255,g=0;4&gt;g&amp;&amp;a+0.75*g&lt;f;g++)b.push(c.charAt(d&gt;&gt;&gt;6*(3-g)&amp;63));if(e=c.charAt(64))for(;b.length%4;)b.push(e);return b.join("")},parse:function(b){var e=b.length,f=this._map,c=f.charAt(64);c&amp;&amp;(c=b.indexOf(c),-1!=c&amp;&amp;(e=c));for(var c=[],a=0,d=0;d&lt;
29 e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))&lt;&lt;2*(d%4),h=f.indexOf(b.charAt(d))&gt;&gt;&gt;6-2*(d%4);c[a&gt;&gt;&gt;2]|=(g|h)&lt;&lt;24-8*(a%4);a++}return j.create(c,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
30
31 var words = CryptoJS.enc.Utf8.parse(input);
32 return CryptoJS.enc.Base64.stringify(words);
33     </script>
34 </dunes-script-module>