تحويل String to Base64
#6
Base64 هو مخطط تشفير يعرض بيانات ثنائية بصيغة ASCII على هيئتها النصية
يستخدم خصيصا لأجل نقل بيانات ثنائية عبر وسائط بصيغة نصية
مما يضمن وصولها إلى المستلم بشكل سليم
Base64 يستخدم عادة مع رسائل البريد الالكتروني (باستخدام المعيار MIME)
كما يستخدم لتخزين بيانات مركبة في صيغة XML
ترجمة عن wikipedia
Daniel Wischnewski قام بتجويد كود Indy للترميز Base64 بكود ASM
PHP كود :
uses SysUtils;

/ / 
A string encoded in base64 representation of the corresponding
Base64Encode 
function (const-Text: AnsiString): AnsiString; overload;
/ / 
Base64-decodes a string representation of the corresponding string
Base64Decode 
function (const-Text: AnsiString): AnsiString; overload;

/ / 
Sets the size of the base-64 representation
CalcEncodedSize 
function (insize: Cardinal): Cardinal;
/ / 
Sets the size of the binary representation
CalcDecodedSize 
function (const InBuffer, insize: Cardinal): Cardinal;

/ / 
A buffer encoded in the corresponding base-64 representation
Base64Encode procedure 
(const InBuffer, insize: Cardinal; OutBuffer var); overload; register;
/ / 
Decode the Base64 representation in a buffer
{$ IFDEF} SpeedDecode
Base64Decode procedure 
(const InBuffer, insize: Cardinal; OutBuffer var); overload; register;
{$ ENDIF}
{$ 
IFDEF} ValidityCheck
Base64Decode 
function (const InBuffer, insize: Cardinal; var OutBuffer): Boolean; overload; register;
{$ ENDIF}

/ / 
A string encoded in base64 representation of the corresponding
Base64Encode procedure 
(const-Text: PAnsiChar var OutText: PAnsiChar); overload;
/ / 
Base64-decodes a string representation of the corresponding string
Base64Decode procedure 
(const-Text: PAnsiChar var OutText: PAnsiChar); overload;

/ / 
A string encoded in base64 representation of the corresponding
Base64Encode procedure 
(const-Text: AnsiString; var OutText: AnsiString); overload;
/ / 
Base64-decodes a string representation of the corresponding string
Base64Decode procedure 
(const-Text: AnsiString; var OutText: AnsiString); overload; 
الكود بأكمله من المصدر:
كود :
http://www.delphipraxis.net/991-base64-mime-en-decoding.html
بالتوفيق.
اللهم احقن دماء المسلمين، لا تنسوهم بالدعاء...
الرد


الردود في هذا الموضوع
تحويل String to Base64 - بواسطة Goblin - 10-04-2009, 11:05 AM
تحويل String to Base64 - بواسطة I_Tiger - 10-04-2009, 04:15 PM
تحويل String to Base64 - بواسطة Dr.MOT - 10-04-2009, 05:40 PM
تحويل String to Base64 - بواسطة I_Tiger - 10-04-2009, 07:52 PM
تحويل String to Base64 - بواسطة DAMAX2010 - 08-02-2012, 05:45 PM
تحويل String to Base64 - بواسطة kachwahed - 08-02-2012, 08:47 PM
تحويل String to Base64 - بواسطة DAMAX2010 - 09-02-2012, 12:47 PM
تحويل String to Base64 - بواسطة kachwahed - 09-02-2012, 06:48 PM
تحويل String to Base64 - بواسطة DAMAX2010 - 10-02-2012, 07:16 PM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم