关于根据java flex代码实现 c#解码的问题 10C

加密的内容:eJzll+9P00AYx9/5h1ziu+FWBhuUGIMVEowjJjMmhJHlaI/t4rU3eteRSkgg0aBEA0Ti3gCKEX2h 8UecGrcI/4B/Bu3Kf+G1rNMZY9DuBZt9dff0+jx3n/vePU/PfYPT04tgAWu8CORUIgbUIibapKUD 2e9QQpDKMTWAbFiE+BYN3YCzBIUGxu0fnTlq6pADeRFomJUItMcxIhoDcvDdTUgsFPNbV8ayCoiB sm8Ihvx+xFIMIA0Lf3OQMCRiUVN0uCnGhAFaXcRU4cR5+cjZeChcc7uEgiUUYRkp/ppaXkrQRAaf 4EifhHpr6kbQBhCqiURSRG5BkZLpbqfi1V4d1b96b1ec9c9R2fS3sZG6UTHNd004ja0P7tq++3HF fVeNxsdW1VRKauOT6EY+7dqpfnFfH7j3l533u+72k0jyQb/IZ/hPJwtcncpPKUoqnQRnHpKzvulu HbhPV53DSkQBpZOnJtQV+nHu1r3llcbzg6PDnQ4cr4Eeo/Og3nhc6RidwZ/pDHX93XOiHW9v36tW j1c3j5/tRD1cUo8BCuTTSUD9PQZo4573Zi8yGmbN5lVqGbwtuQ90P54gb3nVFx24e2b/KrOPjo4l pPTZz+zN6nC75u7eiVj7iOWe4dwVOsxyExuFPCub/saKpy+T6dO0f0dX+XRcqUZEl0z1pLiaZWNU cdkQDSSk/0tcTXRRxRWgO724uuhSb9TXnbXdo1otKh1REcwIPNifn0Z1iI1rmPHBLAjcZY0w+mjA 6Dr0IYJcXNUYZigXJ0jHLBdHeolQWxexGDLLWBVvVKqXKMMcYWPewqadiyuhZeLEkhHBTtxe0Ogl E80rgsrFAuIZxBgsoDwRaipaFLS2ANAyMucIXeizZWhxOhLsqjw8dH7EH1SkC5ehGc6YUw7JOIGF 0FASPrP4Nmr+uBOq3kKaQomlG0qQ/WVpaeY7e0fKiQ==
下面是java flex里的代码,请教c#的解码代码,本人对flash flex不熟
// class Base64Decoder
package mx.utils
{
import flash.utils.*;
import mx.resources.*;

public class Base64Decoder extends Object
{
    public function Base64Decoder()
    {
        work = [0, 0, 0, 0];
        resourceManager = mx.resources.ResourceManager.getInstance();
        super();
        data = new flash.utils.ByteArray();
        return;
    }

    public function flush():flash.utils.ByteArray
    {
        var loc1:*=null;
        if (count > 0) 
        {
            loc1 = resourceManager.getString("utils", "partialBlockDropped", [count]);
            throw new Error(loc1);
        }
        return drain();
    }

    public function reset():void
    {
        data = new flash.utils.ByteArray();
        count = 0;
        filled = 0;
        return;
    }

    public function decode(arg1:String):void
    {
        var loc2:*=NaN;
        var loc1:*=0;
        while (loc1 < arg1.length) 
        {
            loc2 = arg1.charCodeAt(loc1);
            if (loc2 != ESCAPE_CHAR_CODE) 
            {
                if (inverse[loc2] != 64) 
                {
                    work[loc3 = count++] = inverse[loc2];
                    if (count == 4) 
                    {
                        count = 0;
                        data.writeByte(work[0] << 2 | (work[1] & 255) >> 4);
                        filled++;
                        if (work[2] == -1) 
                        {
                            break;
                        }
                        data.writeByte(work[1] << 4 | (work[2] & 255) >> 2);
                        filled++;
                        if (work[3] == -1) 
                        {
                            break;
                        }
                        data.writeByte(work[2] << 6 | work[3]);
                        filled++;
                    }
                }
            }
            else 
            {
                var loc4:*;
                var loc3:*;
                work[loc3 = count++] = -1;
                if (count == 4) 
                {
                    count = 0;
                    data.writeByte(work[0] << 2 | (work[1] & 255) >> 4);
                    filled++;
                    if (work[2] == -1) 
                    {
                        break;
                    }
                    data.writeByte(work[1] << 4 | (work[2] & 255) >> 2);
                    filled++;
                    if (work[3] == -1) 
                    {
                        break;
                    }
                    data.writeByte(work[2] << 6 | work[3]);
                    filled++;
                }
            }
            ++loc1;
        }
        return;
    }

    public function toByteArray():flash.utils.ByteArray
    {
        var loc1:*=flush();
        reset();
        return loc1;
    }

    public function drain():flash.utils.ByteArray
    {
        var loc1:*=new flash.utils.ByteArray();
        copyByteArray(data, loc1, filled);
        filled = 0;
        return loc1;
    }

    internal static function copyByteArray(arg1:flash.utils.ByteArray, arg2:flash.utils.ByteArray, arg3:uint=0):void
    {
        var loc1:*=arg1.position;
        arg1.position = 0;
        arg2.position = 0;
        var loc2:*=0;
        while (arg1.bytesAvailable > 0 && loc2 < arg3) 
        {
            arg2.writeByte(arg1.readByte());
            ++loc2;
        }
        arg1.position = loc1;
        arg2.position = 0;
        return;
    }

    internal static const ESCAPE_CHAR_CODE:Number=61;

    internal static const inverse:Array=[64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 64, 64, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64, 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 64, 64, 64, 64, 64, 64, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64];

    internal var filled:int=0;

    internal var data:flash.utils.ByteArray;

    internal var count:int=0;

    internal var work:Array;

    internal var resourceManager:mx.resources.IResourceManager;
}

}

1个回答

这不是提供了加解密方法么 你调用哈

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐