Re: [fpc-pascal] HMAC_SHA1 and FPC

2013-03-24 Thread silvioprog
Oops ... 2013/3/25 silvioprog [...] > (seven for MD5 and nine for SHA1), ... > ... seven for both. -- Silvio Clécio My public projects - github.com/silvioprog ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/ma

Re: [fpc-pascal] HMAC_SHA1 and FPC

2013-03-24 Thread silvioprog
Please discart the *hmac-sha1only.zip*. I improved the routines for SHA1 ( http://pastebin.com/PKdL2xx7). I'll finish all codes (MD5/SHA1) tomorrow. Now I'm implementing the test cases (seven for MD5 and nine for SHA1), and this will take a little time. Wait ... -- Silvio Clécio My public proje

[fpc-pascal] position of External: SIGFPE

2013-03-24 Thread Xiangrong Fang
Hi, Why the "External: SIGFPE" error not reported on the line it was generated? e.g. In the following code: 1: if SomeCondition then begin 2: Y := exp(Y); 3: end; 4: d := Data[X]; The SIGFPE is generated on line 2, because Y is too big. But while the program is running in IDE, it told me that

Re: [fpc-pascal] HMAC_SHA1 and FPC

2013-03-24 Thread Sven Barth
On 24.03.2013 21:06, silvioprog wrote: 2013/3/24 Sven Barth mailto:pascaldra...@googlemail.com>> On 24.03.2013 19:35, silvioprog wrote: 2013/3/24 Sven Barth mailto:pascaldra...@googlemail.com>

Re: [fpc-pascal] HMAC_SHA1 and FPC

2013-03-24 Thread silvioprog
2013/3/24 Sven Barth > On 24.03.2013 19:35, silvioprog wrote: > >> 2013/3/24 Sven Barth > > >> >> >> On 24.03.2013 16:59, silvioprog wrote: >> >> My function is more fast that cHash >> >> (http://fundementals.__sourcef**orge.net/dl.html<

Re: [fpc-pascal] HMAC_SHA1 and FPC

2013-03-24 Thread Sven Barth
On 24.03.2013 19:35, silvioprog wrote: 2013/3/24 Sven Barth mailto:pascaldra...@googlemail.com>> On 24.03.2013 16:59, silvioprog wrote: My function is more fast that cHash (http://fundementals.__sourceforge.net/dl.html ).

Re: [fpc-pascal] HMAC_SHA1 and FPC

2013-03-24 Thread silvioprog
2013/3/24 Sven Barth > On 24.03.2013 16:59, silvioprog wrote: > >> My function is more fast that cHash >> (http://fundementals.**sourceforge.net/dl.html). >> The comparison result is: >> >> HMAC: 00:00:01:689 cHash: 00:00:02:038 >> >> My final unit is:

Re: [fpc-pascal] HMAC_SHA1 and FPC

2013-03-24 Thread Sven Barth
On 24.03.2013 17:48, Sven Barth wrote: On 24.03.2013 16:59, silvioprog wrote: My function is more fast that cHash (http://fundementals.sourceforge.net/dl.html). The comparison result is: HMAC: 00:00:01:689 cHash: 00:00:02:038 My final unit is: http://pastebin.com/4484g9i8 Could you maybe ru

Re: [fpc-pascal] HMAC_SHA1 and FPC

2013-03-24 Thread Sven Barth
On 24.03.2013 16:59, silvioprog wrote: My function is more fast that cHash (http://fundementals.sourceforge.net/dl.html). The comparison result is: HMAC: 00:00:01:689 cHash: 00:00:02:038 My final unit is: http://pastebin.com/4484g9i8 Could you maybe run your unit through some test vectors if

Re: [fpc-pascal] HMAC_SHA1 and FPC

2013-03-24 Thread silvioprog
I changed it to: http://pastebin.com/mxeWtncP And now: cHash: 00:00:02:188 HMAC: 00:00:00:966 2013/3/24 silvioprog > My function is more fast that cHash ( > http://fundementals.sourceforge.net/dl.html). The comparison result is: > > HMAC: 00:00:01:689 cHash: 00:00:02:038 > > My final unit is

Re: [fpc-pascal] HMAC_SHA1 and FPC

2013-03-24 Thread silvioprog
My function is more fast that cHash ( http://fundementals.sourceforge.net/dl.html). The comparison result is: HMAC: 00:00:01:689 cHash: 00:00:02:038 My final unit is: http://pastebin.com/4484g9i8 The code used in comparison: uses HMAC, cHash; procedure TForm1.Button1Click(Sender: TObject);

Re: [fpc-pascal] HMAC_SHA1 and FPC

2013-03-24 Thread silvioprog
A small improvement: uses SHA1; function SHA1Raw(const ABuffer; const ABufferLength: PtrUInt): string; var I: Byte; VBytes : TBytes; VDigest: TSHA1Digest; VContext: TSHA1Context; begin Result := ''; SHA1Init(VContext); SHA1Update(VContext, ABuffer, ABufferLength); SHA1Final(VCon

Re: [fpc-pascal] HMAC_SHA1 and FPC

2013-03-24 Thread silvioprog
2013/3/24 David Butler > congrats on re-inventing the wheel. all those string > allocations/de-allocations could make it slow. > OK, thank you, and what do you suggest to improve this code? Depend on a huge library of third parties and not simply use native code in FCL? -- Silvio Clécio My pub

Re: [fpc-pascal] Re: Use generic class as parameter (was: how to write enumerator for trees)

2013-03-24 Thread Xiangrong Fang
Thanks Sven :) 2013/3/24 Sven Barth > On 24.03.2013 03:49, Xiangrong Fang wrote: > >> I think the problem is not fixed in 2.7.1: >> >> xrfang@laptop ~/fpc $ ./compiler/ppcx64 -n -Furtl/units/x86_64-linux >> -Fupackages/fcl-base/units/**x86_64-linux -viwn -FE/home/xrfang -Sc >> demo2.lpr >> Targe

Re: [fpc-pascal] FBAdmin

2013-03-24 Thread Mark Morgan Lloyd
Ludo Brands wrote: On 03/24/2013 10:54 AM, Mark Morgan Lloyd wrote: I've added a call to FBAdmin to what I'm working on, to get the full description of the server (i.e. comparable to PostgreSQL's version() function). Thanks Ludo :-) Is it possible to piggyback this onto an open Firebird connect

[fpc-pascal] Re: FBAdmin

2013-03-24 Thread Reinier Olislagers
On 24-3-2013 12:11, Ludo Brands wrote: > On 03/24/2013 10:54 AM, Mark Morgan Lloyd wrote: >> Is there any way of determining what port the client is using for an >> open connection (i.e. not the 3050 at the server end)? Postgres >> implements this with inet_client_port(), and I'm considering a situ

Re: [fpc-pascal] FBAdmin

2013-03-24 Thread Ludo Brands
On 03/24/2013 10:54 AM, Mark Morgan Lloyd wrote: > I've added a call to FBAdmin to what I'm working on, to get the full > description of the server (i.e. comparable to PostgreSQL's version() > function). Thanks Ludo :-) > > Is it possible to piggyback this onto an open Firebird connection, in > ca

[fpc-pascal] Easy string-splitting

2013-03-24 Thread S. Fisher
uses regexpr, classes; var pieces : tstringlist; s : string; begin pieces := TStringList.create; SplitRegExpr( '--+| *, *', 'thus--and even , hurly-burly,willy-nilly', pieces ); for s in pieces do writeln( s, '<'); pieces.destroy; end. Output: thus< a

Re: [fpc-pascal] Re: Use generic class as parameter (was: how to write enumerator for trees)

2013-03-24 Thread Sven Barth
On 24.03.2013 03:49, Xiangrong Fang wrote: I think the problem is not fixed in 2.7.1: xrfang@laptop ~/fpc $ ./compiler/ppcx64 -n -Furtl/units/x86_64-linux -Fupackages/fcl-base/units/x86_64-linux -viwn -FE/home/xrfang -Sc demo2.lpr Target OS: Linux for x86-64 Compiling demo2.lpr Compiling treap.p

[fpc-pascal] FBAdmin

2013-03-24 Thread Mark Morgan Lloyd
I've added a call to FBAdmin to what I'm working on, to get the full description of the server (i.e. comparable to PostgreSQL's version() function). Thanks Ludo :-) Is it possible to piggyback this onto an open Firebird connection, in case somebody interposes some sort of connection pooling la

Re: [fpc-pascal] Re: OOP in FreePascal ARM-Embedded

2013-03-24 Thread Mark Morgan Lloyd
Juan Duran wrote: Graeme Geldenhuys writes: On 2013-02-27 08:28, Juan Duran wrote: Is anybody working on being able to uses classes, methods, etc (OOP) in freepascal compiler for ARM embedded platform? OOP works fine already on that platform... what specific are you looking for? Regards,

Re: [fpc-pascal] HMAC_SHA1 and FPC

2013-03-24 Thread David Butler
congrats on re-inventing the wheel. all those string allocations/de-allocations could make it slow. On Sun, Mar 24, 2013 at 6:12 AM, silvioprog wrote: > Eureka! > > After spending all day working on it, I finally did it! The pseudo steps > are here: > http://en.wikipedia.org/wiki/Hash-based_mess