* * *

Recent Posts

Pages: [1] 2 3 ... 10
1
Cocoa / Re: TScrollBox: scrollbars issue
« Last post by MISV on Today at 05:52:03 pm »
Just for reference: I experience similar issues with TScrollBox
2
A simple example is attached which you can adapt to your needs.
3
General / Re: lpi file correction [Solved]
« Last post by wp on Today at 05:31:37 pm »
Please post your question on the Lazarus mailing list which is read by Maxim Ganetsky who takes care of the translation system.
4
General / Re: Hashes
« Last post by Thaddy on Today at 05:20:02 pm »
5
General / Re: Hashes
« Last post by Thaddy on Today at 05:14:52 pm »
Indeed. These are not components, but classes.
Don't ask for components, they would be over-coding and not very useful in true, real life, settings.
Xor-el would probably never even consider it. (this code is not for - I hear a song - "Absolute Beginners" comes to mind.... 8-))

In this case installing the package simply means the classes are compiled and available for fast linking without re-compiling.
6
Lazarus / Re: Lazarus Release Canditate 1 for 2.0
« Last post by gii on Today at 05:09:49 pm »
Apparently the Outline feature does not work in this version.

7
General / Re: Hashes
« Last post by Xor-el on Today at 05:03:12 pm »
I was trying to install HashLib4Pascal into lazarus, but the Use/Install menu item is grayed out.  Does this mean that these components are not put into a tab?

I tried something like below to use the tiger component, but couldn't get it to work.

<code>
function get_tiger(S: String): String;
var Hash: TDCP_tiger;
    Digest: array[0..23] of byte;  // HashSize = 192
    Source: string;
    i: integer;
    str1: string;
begin
     Source:= S;  // here your string for get sha256

     if Source <> '' then begin
        Hash := Form1.DCP_tiger1;  // create the hash
        Hash.Init;                       // initialize it
        Hash.UpdateStr(Source);
        Hash.Final(Digest);              // produce the digest
        str1 := '';

        for i := 0 to 23 do
            str1 := str1 + IntToHex(Digest, 2);
     end;

     Result := str1;
end;
</code>

First of all,
HashLib4Pascal is a Runtime Package not a Design Time one meaning you can even use it in Console programs.

The Steps are

1. Install the HashLib Package from OPM (online package manager) or from Github (https://github.com/Xor-el/HashLib4Pascal)

2. Add the "HashLib4PascalPackage" to your Program Projects "Required Packages".

3.
Simple One Liner Code to Compute Hash of a String using Tiger_5_192.
Do note that HashLib4Pascal supports incremental Hashing too.
For more examples, take a look at the unit tests, they contain lots of code samples.

Code: Pascal  [Select]
  1.  
  2. uses
  3. SysUtils,
  4. HlpHashFactory;
  5.  
  6. .....
  7.  
  8.  
  9. Result := THashFactory.TCrypto.CreateTiger_5_192().ComputeString('Fish', TEncoding.UTF8).ToString();
  10.  
8
Thanks a lot for your detailed answer.

I also need to run the 32 bit program on my 64 bit Ubuntu. If I only can cross-compile 32 bit, but cannot run it, this makes no sense in my case. Sorry, that I did not mention that in my 1st question.

# Do another Run | Build and it should successfully build a 32-bit executable.
# (you have to run this from a 32-bit Linux OS, or from a 64-bit OS with the proper libraries installed)

Please, which are "the proper libraries installed" which I need to run a 32 bit GUI program?
Thanks again for your help.
9
General / Re: Hashes
« Last post by lazarus9 on Today at 04:13:00 pm »
I was trying to install HashLib4Pascal into lazarus, but the Use/Install menu item is grayed out.  Does this mean that these components are not put into a tab?

I tried something like below to use the tiger component, but couldn't get it to work.

<code>
function get_tiger(S: String): String;
var Hash: TDCP_tiger;
    Digest: array[0..23] of byte;  // HashSize = 192
    Source: string;
    i: integer;
    str1: string;
begin
     Source:= S;  // here your string for get sha256

     if Source <> '' then begin
        Hash := Form1.DCP_tiger1;  // create the hash
        Hash.Init;                       // initialize it
        Hash.UpdateStr(Source);
        Hash.Final(Digest);              // produce the digest
        str1 := '';

        for i := 0 to 23 do
            str1 := str1 + IntToHex(Digest, 2);
     end;

     Result := str1;
end;
</code>
10
General / Re: Copy custom data from existing row to new row in TStringGrid
« Last post by jamie on Today at 03:46:38 pm »
Well I guess you already know what needs to be done since you already have a block of code doing that part for you, why
is it a problem to simply copy the Object elements over to the new location after you determine if they apply?

Pages: [1] 2 3 ... 10

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus