Rules FAQ Members List Search Register Login

 Raised This Month: \$90 Target: \$400 22%

 Thread Tools Display Modes
Author Message
ScriptCoderPro
Junior Member
Join Date: Mar 2009
 03-08-2009 , 18:55   check base64 encode/decode #1 I found base64 encode/decode in Delphi here: http://www.swissdelphicenter.ch/torr...de.php?id=1524 and translate it to Pawn. Please check it and help with this functions, I'm newbie in Pawn. Code: #include static const Codes64[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/" public Encode64(s[]) { new i=0,a=0,x=0,b=0,Result for (i=1;i= 6) { a = a - 6 x = b / (1 << a) b = b % (1 << a) Result += Codes64[x + 1] } } if (a > 0) { x = b << (6 - a); Result += Codes64[x + 1]; } return Result; } public Decode64(s[]) { new i=0,a=0,x=0,b=0,Result,ch[1] for (i = 1; i< strlen(s);i++) { for (new index = 0; Codes64[index]; index++) if (s[i]==Codes64[index]) { x=index-1 break } if (x >= 0) { b = b * 64 + x a = a + 6 if (a >= 8) { a = a - 8 x = b >> a b = b % (1 << a) x = x % 256 Result += num_to_word(x,ch,1) } } else exit; } return Result; } Last edited by ScriptCoderPro; 03-09-2009 at 08:50.
[ --<[email protected] ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
 03-08-2009 , 19:09   Re: check base64 encode/decode #2 What's the problem? Easiest way is to try it out. Last edited by [ --<[email protected] ] Black Rose; 03-09-2009 at 14:48.
ScriptCoderPro
Junior Member
Join Date: Mar 2009
 03-09-2009 , 08:50   Re: check base64 encode/decode #3 I updated my first post. Check it now.
[ --<[email protected] ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
03-09-2009 , 14:48   Re: check base64 encode/decode
#4

I used another C++ source. I don't know anything about delphi. I have no clue what it does. It works.

I hope you were looking for the function and not learning how to do it.
Attached Files
 base64.inc (3.8 KB, 469 views)

Last edited by [ --<[email protected] ] Black Rose; 03-09-2009 at 16:11.
ScriptCoderPro
Junior Member
Join Date: Mar 2009
 03-10-2009 , 16:14   Re: check base64 encode/decode #5 Very very big thx!!! Man (or woman ) it's excellently made work! For simple test it works. I will test it more and write if it's not work. Now I can realize crypto algorithm with xor and non standart symbols.
ScriptCoderPro
Junior Member
Join Date: Mar 2009
 03-10-2009 , 18:00   Re: check base64 encode/decode #6 I have a question how I can emulate two delphi functions in Pawn? 1) Ord("A") - returns number of symbol - 65 2) Chr(65) - returns from number symbol - "A" Thx!
[ --<[email protected] ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
 03-10-2009 , 18:14   Re: check base64 encode/decode #7 You don't have to. 'A' is equal to 65 in pawn. so if you have a string like this: string[3] = "ABC" and use it like this: server_print("%c/%d", string[0], string[0]); it would print "A/65" Last edited by [ --<[email protected] ] Black Rose; 03-10-2009 at 18:17.
ScriptCoderPro
Junior Member
Join Date: Mar 2009
 03-11-2009 , 13:39   Re: check base64 encode/decode #8 thx
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
03-11-2009 , 14:27   Re: check base64 encode/decode
#9

What is the purpose of a base64 string?
__________________
No private work or selling mods.
Quote:
 Originally Posted by xPaw I love you exolent!
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
03-11-2009 , 15:02   Re: check base64 encode/decode
#10

Quote:
 Originally Posted by Exolent[jNr] What is the purpose of a base64 string?
It's just like any form of encoding.
__________________

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Server Discussion     Source Servers (SRCDS)     HL1 Servers (HLDS) AMX Mod X     News     Bug Reports     General     Off-Topic     Plugins         Suggestions / Requests         Approved Plugins         New Plugin Submissions         Unapproved/Old Plugins         Translation Request         High-Traffic Plugins             GunGame             UAIO (Ultimate All-In-One Plugin)             xREDIRECT             CSDM             AMX Super             RuneMod             Zombie Plague Mod             SuperHero Mod                 News                 Tech Support                 Scripting Help                 Off-Topic / General Chat                 Heroes                     Suggestions / Requests                     Approved Heroes                     New Submissions                     Unapproved/Old Heroes                         Module Heroes                     SuperHero Mod Stats - By 123                 (OLD) Bug Reports     Scripting         Scripting Help         Code Snippets/Tutorials         Module Coding     Donor Access SourceMod     News     General     Plugins         Plugins         Unapproved Plugins         Plugin/Gameplay Ideas and Requests         High-Traffic Plugins             SourceMod Anti-Cheat             Zombie:Reloaded             SourceBans             VSH / Freak Fortress             Store             SM_Hosties             HLstatsX:CE     Scripting     Extensions     Snippets and Tutorials     Donor Access     Metamod: Source         Metamod:Source Plugins         Metamod:Source Questions         Coding MM:S Plugins & SM Extensions Hosted Stuff     Asherkin's Plugins         TF2Items         TFDodgeball         SteamTools     Bail's Plugins         CSDM         CS:S DM Off-Topic & Trash     Off-Topic     Trash

All times are GMT -4. The time now is 05:12.

 DMCA - Archive - Top