[Java] vl64 & base64 encoding

Results 1 to 15 of 15
  1. #1
    Chasing 99 Red Balloons Jordan is offline
    MemberRank
    Jan 2008 Join Date
    UKLocation
    1,763Posts

    [Java] vl64 & base64 encoding

    Java habbo encoding class's
    Class's taken from Jase / Woodpecker II and ported to Java please leave the @author comments intact if you distribute / use this
    vl64/wire:
    PHP Code:
    package com.encoding;

    /*
     * vl64 encoding for habbo servers in Java
     * 
     * @author Who ever wrote the C# version, Lord Jordan Porting
     */
    public class vl64Habbo {
        public static 
    String Encode(int i)
        {
            
    byte[] wf = new byte[6];
            
    int pos 0;
            
    int startPos pos;
            
    int bytes 1;
            
    int negativeMask >= 4;
            
    Math.abs(i);
            
    wf[pos++] = (byte)(64 + (3));
            for (
    >>= 2!= 0>>= 6)
            {
                
    bytes++;
                
    wf[pos++] = (byte)(64 + (0x3f));
            }

            
    wf[startPos] = (byte)(wf[startPos] | bytes << negativeMask);
            
    String tmp = new String(wf); //encoder.GetString(wf);
            
    return tmp.replace("\0""");
        }
        public static 
    int Decode(String data)
        {
            
    char[] chars;
            
    chars data.toCharArray();
            return 
    Decode(chars);
        }
        public static 
    int Decode(char[] raw)
        {
            try {
            
    int pos 0;
            
    int v 0;
            
    boolean negative = (raw[pos] & 4) == 4;
            
    int totalBytes raw[pos] >> 7;
            
    raw[pos] & 3;
            
    pos++;
            
    int shiftAmount 2;
            for (
    int b 1totalBytesb++)
            {
                
    |= (raw[pos] & 0x3f) << shiftAmount;
                
    shiftAmount b;
                
    pos++;
            }

            if (
    negative == true)
                
    *= -1;
            return 
    v;
            }
            catch (
    Exception e) {
                return 
    0;
            }        
        }    

    base64:
    PHP Code:
    package com.encoding;
    /*
     * base64 encoding for habbo servers in Java
     * 
     * @author Who ever wrote the C# version, Lord Jordan Porting
     */
    public class base64Habbo {
        public static 
    String Encode(int i)
        {
            try
            {
                
    String s "";
                for (
    int x 1<= 2x++)
                    
    += (char)((byte)(64 + (>> * (x) & 0x3f)));
                return 
    s;
            }
            catch (
    Exception e)
            {
                
    System.out.println(e.toString());
                return 
    "";
            }        
        }
        public static 
    int Decode(String s)
        {
            try
            {
                
    char[] val s.toCharArray();
                
    int intTot 0;
                
    int y 0;
                for (
    int x = (val.length 1); >= 0x--)
                {
                    
    int intTmp = (int)(byte)((val[x] - 64));
                    if (
    0)
                        
    intTmp intTmp * (int)(Math.pow(64y));
                    
    intTot += intTmp;
                    
    y++;
                }
                return 
    intTot;
            }    
            catch (
    Exception e)
            {
                
    System.out.println(e.toString());
                return 
    0;
            }    
        }



  2. #2
    Infraction Banned Suzushima is offline
    MemberRank
    Apr 2009 Join Date
    686Posts

    Re: [Java] vl64 & base64 encoding

    As I told you, you helped me out and thanks.

    I got a question for my R30 Server should I Java or C#? Im good at both so its not a problem with coding I just want to know about performance.

  3. #3
    Chasing 99 Red Balloons Jordan is offline
    MemberRank
    Jan 2008 Join Date
    UKLocation
    1,763Posts

    Re: [Java] vl64 & base64 encoding

    Probably C# since there are more coders in the section who know the language :P (more support) and if your new to habbos protocol you may struggle to grasp it at first.

    Pleasure i could help :)

  4. #4
    Infraction Banned Suzushima is offline
    MemberRank
    Apr 2009 Join Date
    686Posts

    Re: [Java] vl64 & base64 encoding

    Quote Originally Posted by Lord Jordan View Post
    Probably C# since there are more coders in the section who know the language :P (more support) and if your new to habbos protocol you may struggle to grasp it at first.

    Pleasure i could help :)

    @Mark get out of my thread this is not a fucking server dev thread use the fucking pm function
    Yea, but I got to say not much Coders in RZ.I dont think I can count 10 on my fingers anymore.

    Also Mark I made a DEV thread it should be approved firstby MODS.Also may I ask why make your post count bigger by making useless posts.Making more post counts doesnt make ur d1ck bigger....

    Also thanks Lord I salut you

    Your release is useful for Coders so all you scrubs get off.People will probably come and say nice release and wont even know whats base64

  5. #5
    Account Upgraded | Title Enabled! HabbyDeluxe is offline
    MemberRank
    Dec 2007 Join Date
    679Posts

    Re: [Java] vl64 & base64 encoding

    Thanks, for this!
    ;)

  6. #6
    Fuck You Retro! is offline
    MemberRank
    Jun 2007 Join Date
    4,346Posts

    Re: [Java] vl64 & base64 encoding

    This is helpful
    thanks for the release,
    :)

  7. #7
    The one and only! Hejula is offline
    MemberRank
    Nov 2008 Join Date
    4,128Posts

    Re: [Java] vl64 & base64 encoding

    Excelent, shall be usefull ;D thanksyou

  8. #8
    Infraction Banned Superszz is offline
    MemberRank
    Apr 2009 Join Date
    98Posts

    Re: [Java] vl64 & base64 encoding

    This is C# no Java /fail

  9. #9
    Infraction Banned Suzushima is offline
    MemberRank
    Apr 2009 Join Date
    686Posts

    Re: [Java] vl64 & base64 encoding

    Quote Originally Posted by Superszz View Post
    This is C# no Java /fail
    Your the fail.Lord Jordan must know what hes talking about also the vl64/wire: is JavaScript

  10. #10
    Chasing 99 Red Balloons Jordan is offline
    MemberRank
    Jan 2008 Join Date
    UKLocation
    1,763Posts

    Re: [Java] vl64 & base64 encoding

    Quote Originally Posted by Superszz View Post
    This is C# no Java /fail
    Thats strange notice "package" "import" etc thats Java, and the fact i ported it to Java you sir need to learn when to shut up.

    @Above its Java not Java Script theres a diffrence hehe

  11. #11
    pork pork Parker is offline
    MemberRank
    Dec 2007 Join Date
    new holland.Location
    5,873Posts

    Re: [Java] vl64 & base64 encoding

    Quote Originally Posted by Jordan View Post
    Thats strange notice "package" "import" etc thats Java, and the fact i ported it to Java you sir need to learn when to shut up.

    @Above its Java not Java Script theres a diffrence hehe
    This is why I have doubts about his emulator

    Nice release

  12. #12
    Infraction Banned Suzushima is offline
    MemberRank
    Apr 2009 Join Date
    686Posts

    Re: [Java] vl64 & base64 encoding

    Quote Originally Posted by Parker View Post
    This is why I have doubts about his emulator

    Nice release
    Yea, You have doubts.... Im not using any Java.Ill be using C# anyways.

  13. #13
    pork pork Parker is offline
    MemberRank
    Dec 2007 Join Date
    new holland.Location
    5,873Posts

    Re: [Java] vl64 & base64 encoding

    Quote Originally Posted by Suzushima View Post
    Yea, You have doubts.... Im not using any Java.Ill be using C# anyways.
    What I meant was you know C#/java but you called it Javascript, it just didn't add up.

  14. #14
    Chasing 99 Red Balloons Jordan is offline
    MemberRank
    Jan 2008 Join Date
    UKLocation
    1,763Posts

    Re: [Java] vl64 & base64 encoding

    Quote Originally Posted by Parker View Post
    This is why I have doubts about his emulator

    Nice release
    Thanks parker :-]

    Ah shit its 6:45am 0.0

  15. #15
    Account Upgraded | Title Enabled! Habbie is offline
    MemberRank
    Mar 2009 Join Date
    302Posts

    Re: [Java] vl64 & base64 encoding

    hahah Superszz fails every time he post something lol



Advertisement