Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
@paweld,
I added your example to the wiki
https://wiki.freepascal.org/HashLib4Pascal#Example
2
HashLib4Pascal is not a visual component, so you won't click it off the component list.
To add an installed non-visual component to your project, click on menu "Project > Project inspector ...". (1)
In the newly opened window, add a new dependency: "Add > New requirement" (2) and you select "HashLib4PascalPackage" and click "OK" (3) - now you can close the "Project inspector" window.
Then in the uses section you need to add the modules needed to generate HMAC:
Code: Pascal  [Select][+][-]
  1. uses
  2.  //...
  3.  HlpIHashInfo, HlpConverters, HlpHashFactory;
.
and the code that generates the HMAC looks something like this:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. var
  3.   LHMAC: IHMAC;
  4.   barr: TBytes;
  5.   tekst, secret_key, hmac512_value: String;
  6. begin
  7.   tekst := 'test';
  8.   secret_key := '123';
  9.   LHMAC := THashFactory.THMAC.CreateHMAC(THashFactory.TCrypto.CreateSHA2_512);
  10.   LHMAC.Key := TConverters.ConvertStringToBytes(secret_key, TEncoding.UTF8);
  11.   hmac512_value := LHMAC.ComputeString(tekst, TEncoding.UTF8).ToString();
  12.   ShowMessage(hmac512_value);
  13. end;    
3
General / Re: How to: create DLL file for Windows 10 64-Bit Pro
« Last post by paule32 on Today at 07:03:32 am »
on building a DLL, I get in next trouble, and I don't know why:
- I have an extra file where the type def's of some custom types are present.
- in foo.pas, I have a line:  type NTSTATUS = LongInt;

- in a second file: bar.pas, a library declared file
- in bar.pas, I include the foo.pas with {$I foo.pas}
- the file will be include
- the file path settings are okay

- when I try to use NTSTATUS within a procedure:

Code: Pascal  [Select][+][-]
  1. procedure test;
  2. var
  3.   status: NTSTATUS;
  4. begin
  5. end;

I get fpc error, that NTSTATUS is not declared identifier.

- when I (re-declare) the type NTSTATUS = LongInt; in bar.pas, I get no errors.

What is going on there ?
A next eastern egg of the compiler ?
4
.......in the next release of the compiler.
The next release ?  Wow, it would be so good to see that.
Davo

Waiting for Godot?

Hmm, maybe. But Godot never actually arrives. Hmm....

Davo
5
QT / Re: Distro has depreciated qt5pas-dev how to build?
« Last post by dbannon on Today at 06:30:51 am »
While I am not familiar with  IpHtmlPanel it does not appear to be anything to do with Qt5 or the widget set. I suggest you may be barking up the wrong tree.

You could test by trying to build a GTK2 version of your project, if also errors, then the issue is not widget set related.

Sounds like you are transitioning between Lazarus 2.2.6 and 3.2, be more likely there has been some change there IMHO. Have you checked the 3.2 changes list ?

EDIT : https://wiki.freepascal.org/Lazarus_3.0_release_notes#TurboPower_ipro

Davo
6
Sorry in advance, I'm a beginner programmer, I want to ask how to install cryptolib / hashlib in my form project. even though I have installed the packages via the Online Package Manager and it has been installed but I don't know how to use it, this happens to be a project that requires HMAC SHA-512.
7
Hi!

.... and also after installing a new version of BGRABitmap, the BGRA.TextRect() does not clip off text that is too long.
Could there be some problem on my computer? (Windows 10)
Can anyone check this?
8
FPC development / Re: TiniFile alters inifile comments
« Last post by polinkuer12 on Today at 05:27:15 am »


I have no trick, but you can alter the behaviour to what you want by changing the IsComment function of the Inifiles unit. Unfortunately it is a stand-alone function, not a virtual method of TIniFile which could be overridden without needing to tinker with the source. Simply change it to the following: Quick Draw

Code: [Select]

function IsComment(const AString: string): boolean;
const
  Comments: set of Char =[';','#'];
var
  c: char;
begin
  Result := False;
  if (AString > '') then
    Result:=(AString[1] in Comments);
end;

Rather than alter the sources, I would just copy the source to your project directory, renaming to something other than inifile, and put the altered file in your uses clause, rather than inifile.
[/quote]
oh thank you so much for sharing this, I will try to apply it
9
QT / Re: Distro has depreciated qt5pas-dev how to build?
« Last post by TheMouseAUS on Today at 03:26:50 am »
Thanks for your help.

My distro just updated Lazarus from 2.2.6 to 3.2 and depreciated QT5pas at the same time but I thing the issue is deeper than that.

I actually used your package to start with but I was having issues so I thought I would build from scratch using the info in  /lazarus/lcl/interfaces/qt5/cbindings/ as suggested by dogriz but still had issues with things not opening correctly. I ended up creating a VM with Fedora and set that up (Lazarus 2.2.6) as I really need it working as I am currently in the middle of a Project.

Errors both with packaged libQt5Pas and built one :-
I use IpHtmlPanel in my project and IpHtmlPanel.Scroll(hsaEnd) but it errors on unable to find hsaEnd (i know it exists as I checked iphtml.pas in the turbopower_ipro folder. Project also complains that it cannot find IpHtml (2.2.6 would do that sometimes as well) so I thought I would add via the Poject Inspector just to see what would happen and I got "Unable to create KIO worker. Can not create a socket for launching a KIO worker for protocol 'file' " so I gave up as i dont have time ATM to deal with this.

These issues were also present when I compiled the IDE to use QT6 and attempted to compile the project using QT6.

My distro decided to depreciate qt5pas-dev so I am now unable to build with qt5. I am trying to figure out where and how to build it for myself. Can someone point me in the right direction? Thanks

If you mean that your distro has libqt5pas but not libqt5pas-dev then its easy, in practice all the -dev library is is a symlink to the basename.so

eg -

Code: Pascal  [Select][+][-]
  1. dbannon@dell:~/Pascal/tomboy-ng/source$ ls -la /usr/lib/x86_64-linux-gnu/libQt5Pas*
  2. lrwxrwxrwx 1 root root      19 Sep  5  2023 /usr/lib/x86_64-linux-gnu/libQt5Pas.so -> libQt5Pas.so.1.2.15
  3. lrwxrwxrwx 1 root root      19 Sep  5  2023 /usr/lib/x86_64-linux-gnu/libQt5Pas.so.1 -> libQt5Pas.so.1.2.15
  4. lrwxrwxrwx 1 root root      19 Sep  5  2023 /usr/lib/x86_64-linux-gnu/libQt5Pas.so.1.2 -> libQt5Pas.so.1.2.15
  5. -rw-r--r-- 1 root root 2689976 Sep  5  2023 /usr/lib/x86_64-linux-gnu/libQt5Pas.so.1.2.15

Without the -dev package, you don't get the  libQt5Pas.so symlink, needed at link time. So, create it.

If you meant to say you cannot get the actual library, in this case, libQt5Pas.so.1.2.15 then its only a touch harder. As dogriz said, instructions in the source, its easy but a time consuming process so I have made available precompiled and packaged one at https://github.com/davidbannon/libqt5pas, there you will find debs and rpms. Also, just a plain tgz of the libarary and further instructions to put in in place on a system that does not use one of those packages. And you will find the scripts I use to build and package ....

Davo

10
Windows / Re: FP IDE(FP.exe) fails to start, Under win
« Last post by gasensor on Today at 03:00:19 am »
I have installed the installer myself, no problems. Please make sure your antivirus hasn't become selfaware due to AI, and thus a bit paranoid.

After testing, this failure occurred in the Chinese version of win10.

Using the English/japanese version of win10, everything works fine.
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018