Welcome, Guest
Username: Password: Remember me
General discussions, feature requests for CodeTyphon Project and discussions that don't fit in any of the other specific CodeTyphon forum categories.
  • Page:
  • 1

TOPIC:

TDCP_sha256 decode hash 5 years 9 months ago #11814

  • Md. Shariful Alam Khan
  • Md. Shariful Alam Khan's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 111
  • Thank you received: 0
Is there a way to decode hash from TDCP_sha256?

Please Log in or Create an account to join the conversation.

TDCP_sha256 decode hash 5 years 9 months ago #11816

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
Please Sir
look at pl_DCP and pl_HashLib4Pascal libraries
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

TDCP_sha256 decode hash 5 years 9 months ago #11822

  • Tigr
  • Tigr's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 1
I think you will find it useful depending on the task!

here is a simple implementation without HMAC:
uses DCPsha256, cHash;

///for cHash
SHA256DigestToHex(CalcSHA256('some text'));////:String




function DigestToStr(Digest: array of byte): string;
var
i: Integer;
begin
Result := '';
for i := 0 to Length(Digest)-1 do
Result := Result + LowerCase(IntToHex(Digest, 2));
end;




function GetStringHash(Source: string): string;
var
Hash: TDCP_sha256;
Digest: array[0..31] of Byte;
begin
Hash := TDCP_sha256.Create(nil);
Hash.Init;
Hash.UpdateStr(Source);
Hash.Final(Digest);
Hash.Free;
Result := DigestToStr(Digest);
end;

File Attachment:

File Name: cDefines.zip
File Size:29 KB
Attachments:

Please Log in or Create an account to join the conversation.

Last edit: by Tigr.

TDCP_sha256 decode hash 5 years 9 months ago #11823

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
Thanks Sir
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

TDCP_sha256 decode hash 5 years 9 months ago #11824

  • Tigr
  • Tigr's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 1
Sternas, I have a question for you of a slightly different nature... Why, when creating an array of strings[64] with above 30 000 000 ide just compiles but does not run the program?
ide64, memory 32 GB
/ / can somewhere that it is necessary to expose?
c:array[1..30000000] of string[64]; // I need 50kk (((((

Please Log in or Create an account to join the conversation.

Last edit: by Tigr.

TDCP_sha256 decode hash 5 years 9 months ago #11825

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
First of all my friend

c:array[1..30000000] of string[64]; it's not good programming sample :(

For so big data we use TMemorySream or Streams or TList or TStringsList or a small Database, etc

Anyway: Did you try to run your app with NO Debug data ?
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

TDCP_sha256 decode hash 5 years 9 months ago #11826

  • Tigr
  • Tigr's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 1
//if 50kk

gdb command:
"- exec-run"
return an error:
",msg="Error creating process C:\\...\315\356\342\340\377 \357\340\357\352\340\\project1.exe, (error 193).""

Please Log in or Create an account to join the conversation.

TDCP_sha256 decode hash 5 years 9 months ago #11827

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
Did you try to run your app with NO Debug info ?
a simple run ?
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

TDCP_sha256 decode hash 5 years 9 months ago #11828

  • Tigr
  • Tigr's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 1
I run with Debug info

Please Log in or Create an account to join the conversation.

TDCP_sha256 decode hash 5 years 9 months ago #11829

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
My suggestion is to
put your programs in a folder containing no spaces
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

TDCP_sha256 decode hash 5 years 9 months ago #11830

  • Tigr
  • Tigr's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 1
Question on backfill... when TmemoryStream access to read data will be faster than with the array?

Please Log in or Create an account to join the conversation.

TDCP_sha256 decode hash 5 years 9 months ago #11831

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
Theoretically: NO
Practically: YES (if you delete,copy,insert, etc data)
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

TDCP_sha256 decode hash 5 years 9 months ago #11832

  • Tigr
  • Tigr's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 1
Do you have a better solution when working with big data?

Please Log in or Create an account to join the conversation.

Last edit: by Tigr.

TDCP_sha256 decode hash 5 years 9 months ago #11833

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
My Suggestion for
memory Big data, different from each other :
TObjectList info or TFPObjectList info
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

Last edit: by Sternas Stefanos.

TDCP_sha256 decode hash 5 years 9 months ago #11834

  • Tigr
  • Tigr's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 1
Thanks!

Please Log in or Create an account to join the conversation.

TDCP_sha256 decode hash 5 years 9 months ago #11835

  • Tigr
  • Tigr's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 54
  • Thank you received: 1
c:array of string[64];
If you use a dynamic array, the program works fine! At the moment, more than 30kk have already been filled, this is the result!

Please Log in or Create an account to join the conversation.

TDCP_sha256 decode hash 5 years 9 months ago #11836

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
  • Posts: 4512
  • Thank you received: 1101
Have fun Sir
PilotLogic Architect and Core Programmer

Please Log in or Create an account to join the conversation.

  • Page:
  • 1