Jump to content

Ugochukwu Mmaduekwe

  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Ugochukwu Mmaduekwe

  1. Ugochukwu Mmaduekwe


    NumCPULib4Pascal is a Cross Platform Pascal library to query the number of CPUs (Logical (logical processors) and Physical (cores)) on a machine. Usage Add NumCPULib to uses clause: uses NumCPULib; var lcc, pcc: Int32; begin // count logical cpus (aka logical processors) lcc := TNumCPULib.GetLogicalCPUCount(); // count physical cpus (aka cores) pcc := TNumCPULib.GetPhysicalCPUCount(); end; What is the difference between the existing System.CPUCount and NumCPULib4Pascal? 1. System.CPUCount only reports the LogicalCPU Count (aka logical processors), it has no option to report the PhysicalCPU Count (cores). 2. System.CPUCount will not report the correct value on windows systems with more than 64 logical processors. NumCPULib4Pascal fixes this by querying GetLogicalProcessorInformationEx on these OSes. GitHub Repository NumCPULib4Pascal
  2. Ugochukwu Mmaduekwe


    if you use Berlin upwards, you can use the inbuilt version found here else you can try the code below. you will need this library though program SimpleHMAC; uses SysUtils, HlpHashFactory; var param_str, secret, sign: string; begin try secret := 't7T0YlFnYXk0Fx3JswQsDrViLg1Gh3DUU5Mr'; param_str := 'api_key=B2Rou0PLPpGqcU0Vu2&leverage=100&symbol=BTCUSD&timestamp=1542434791000'; sign := THashFactory.THMAC.CreateHMAC(THashFactory.TCrypto.CreateSHA2_256(), TEncoding.UTF8.GetBytes(secret)).ComputeString(param_str, TEncoding.UTF8).ToString(); WriteLn(LowerCase(sign)); ReadLn; except raise; end; end.
  3. Well, have you tried Mormot's implementation? https://github.com/synopse/SynPDF/blob/master/SynCrypto.pas You can also try HashLib4Pascal if you want. https://github.com/Xor-el/HashLib4Pascal/ Also you can try out Wolfgang Ehrhardt aka Gammatester (RIP) excellent Hash libraries which contains HMAC implementations too. http://www.wolfgang-ehrhardt.de/crchash_en.html These are guaranteed to work on Delphi 2010 and above and don't require any external DLLs for as long as I remember.
  4. @Clément, To be sincere, I tend to keep pointer constructs to a minimum (to be on the safe side) since the size of integers varies on a various platforms supported by Delphi. Also any reason why you reimplemented HMAC when it is supported in modern Delphi versions?
  5. Ugochukwu Mmaduekwe

    The Android 64bit deadline warnings have started

    Well I use Lazarus on Windows and Linux and it is quite stable (especially on Linux), I think the issue you are experiencing may be related to just Mac OSX. Can you try to install the trunk version using fpcdeluxe? Your issue might have been fixed there.
  6. Ugochukwu Mmaduekwe

    The Android 64bit deadline warnings have started

    32 or 64bit Lazarus? Trunk or stable release?
  7. Inline is a way to hint the compiler to avoid calling a method and instead take the contents of that method and place it at the call site.
  8. Ugochukwu Mmaduekwe

    Win XP app fails to start -- missing bcrypt.dll

    This might have something to do with newer OpenSSL Dlls switching from using the Legacy CryptoAPI to using BCryptGenRandom for generating OS Random numbers.
  9. Ugochukwu Mmaduekwe

    Delphi compiler need to be opensourced

    Lol, at least we now agree on a common fact that for now Delphi doesn't have a PurePascal EdDSA implementation.
  10. Ugochukwu Mmaduekwe

    Delphi compiler need to be opensourced

    Seems you have made up your mind that nothing good and optimal can come out of non native code. In this case, there is very little I can say to convince you otherwise. By the way, the current media player I use is written in JavaScript and it runs beautifully for me on both my Windows and Linux boxes.
  11. Ugochukwu Mmaduekwe

    Delphi compiler need to be opensourced

    Really? Do we have to go down this road again? ECDSA (Elliptical Curve DSA) <> EdDSA (Edwards Curve DSA). It has a lot of use cases as ECDSA and it is been used in Monero and Nano to mention but a few.
  12. Ugochukwu Mmaduekwe

    Delphi compiler need to be opensourced

    Really? I have seen highly performant programs including media players written in .NET and even JavaScript.
  13. Ugochukwu Mmaduekwe

    Delphi compiler need to be opensourced

    This implements just ECDSA using only secp256r1 curve.
  14. Ugochukwu Mmaduekwe

    Delphi compiler need to be opensourced

    @Joseph MItzen you just analysed everything perfectly from my point of view. 👍
  15. Ugochukwu Mmaduekwe

    Delphi compiler need to be opensourced

    Yes It is my project and no it doesn't implement Edwards curves.
  16. Ugochukwu Mmaduekwe

    Delphi compiler need to be opensourced

    Asymmetric Cryptography especially stuffs involving elliptical curves like Edwards curves.
  17. Ugochukwu Mmaduekwe

    Delphi compiler need to be opensourced

    Unfortunately, the CodeTyphoon team seems more focused on the IDE than the compiler.
  18. Ugochukwu Mmaduekwe

    Delphi compiler need to be opensourced

    1. Invest enough to cover the cost of further development and improvements to the compiler? At what gain? It's not like the Delphi ecosystem is really booming. 2. An example of such are Cryptographic Libraries and please don't tell me that Delphi can utilize C/C++ libraries because you and I know how unfriendly that can be (especially finding already compiled libraries for other platforms other than windows) coupled with the problem of distributing the extra binary files. Using C++ libraries was ok at a time when Delphi was Windows only but please we are in the Cross Platform era now. And please do note that I am referring to free OpenSource maintained libraries not closed source sharewares.
  19. Ugochukwu Mmaduekwe

    Delphi compiler need to be opensourced

    While I feel it is not possible for Delphi to open source it's compiler, I highly doubt there are skilled personnels even willing to invest time to improve it for free. The bitter truth is that unfortunately the Delphi ecosystem is not as friendly and lively as other languages ecosystem. A glaring example is the availability of OpenSource libraries to achieve certain operations is no where as vast as that we have in C#, Java or even C++. The VCL and RTL is a different story though.
  20. How do you all test your codebase especially those that use DUnit Testing Framework on mobile devices like Android and iOS. I still do it the old fashion way, compile the demo project with the tests and execute them on my device. while the above works, it's to say the least very stressful. Are there better ways to test my code with DUnit on mobile devices something like a DUnit GUI TestRunner for FMX? Thanks.
  21. Ugochukwu Mmaduekwe

    Travis CI joins Idera

    https://blog.travis-ci.com/2019-01-23-travis-ci-joins-idera-inc Does this mean we get to see Delphi support in Travis CI. What do you all think?
  22. I just hope this nice plugins will not be killed slowly by Embarcadero after integration in the IDE like they did with Castalia.
  23. Ugochukwu Mmaduekwe

    Complete Boolean Evaluation

    because I was been too meticulous.
  24. Ugochukwu Mmaduekwe

    Running UnitTests for Mobile Devices

    Am not sure he is still active on the project. There are open pull requests which are yet to be attended to by him.
  25. I read somewhere online (can't remember where exactly), that StrToUInt64 was buggy in the first version it was released and was fixed in the next compiler release. Anyone have additional information regarding this, (that is what version of Delphi it was first available in and hopefully the version the said bug was fixed in)? Thanks.