[DUG] Brain explosion ! (mime64)
Kyley Harris
Kyley at harrissoftware.com
Tue Aug 25 14:53:54 NZST 2009
i use the Free DIMime under Sourceforge.. works perfectly has lots of
options.
On Tue, Aug 25, 2009 at 2:46 PM, Pieter De Wit <pieter at insync.za.net> wrote:
> Hi,
>
> Maybe you should pad this string to 4 before encoding it ?
>
> Cheers,
>
> Pieter
>
> On Tue, 25 Aug 2009, Robert martin wrote:
>
> > Hi
> >
> > I have a set of functions (not written by me) that encode and decode
> > mime64 data. I want to take a file and mime64 encrypt it than at a
> > later point decrypt it. However I am having trouble calling the
> > functions and there is no help.
> >
> > Functions
> >
> > function Base64Encode(const InText: string): string; overload;
> >
> > function Base64Decode(const InText: string): string; overload;
> >
> >
> > To do the encode I have the following function
> >
> > var
> > fs : TFileStream;
> > BufferIn : AnsiString;
> > begin
> > fs := TFileStream.Create(FileName, fmOpenRead);
> > try
> > fs.Position := 0;
> >
> > SetString(BufferIn, nil, fs.Size);
> > fs.Read(Pointer(BufferIn)^, fs.Size);
> > Result := Base64Encode(BufferIn);
> > finally
> > fs.Free;
> > end;
> >
> >
> > I use a string list to save the output. I thought this was working but
> > when I come to decode it the system checks and finds it is an invalid
> > file (does not divide evenly by 4). Can anyone see what might be wrong
> > with the above?
> >
> > Cheers
> > Rob
> >
> > _______________________________________________
> > NZ Borland Developers Group - Delphi mailing list
> > Post: delphi at delphi.org.nz
> > Admin: http://delphi.org.nz/mailman/listinfo/delphi
> > Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
> unsubscribe
> >
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
> unsubscribe
>
--
Kyley Harris
Harris Software
+64-21-671-821
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20090825/46696727/attachment.html
More information about the Delphi
mailing list