Forum

× General discussions, feature requests for CodeTyphon Project and discussions that don't fit in any of the other specific CodeTyphon forum categories.

Question TDCP_sha256 decode hash

  • Md. Shariful Alam Khan
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
4 months 4 days ago #11814 by Md. Shariful Alam Khan
TDCP_sha256 decode hash was created by Md. Shariful Alam Khan
Is there a way to decode hash from TDCP_sha256?

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 months 4 days ago #11816 by Sternas Stefanos
Replied by Sternas Stefanos on topic TDCP_sha256 decode hash
Please Sir
look at pl_DCP and pl_HashLib4Pascal libraries

CodeTyphon Architect and Programmer

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

More
4 months 58 minutes ago - 4 months 48 minutes ago #11822 by Tigr
Replied by Tigr on topic TDCP_sha256 decode hash
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:
Last edit: 4 months 48 minutes ago by Tigr.

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 months 54 minutes ago #11823 by Sternas Stefanos
Replied by Sternas Stefanos on topic TDCP_sha256 decode hash
Thanks Sir

CodeTyphon Architect and Programmer

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

More
4 months 50 minutes ago - 4 months 46 minutes ago #11824 by Tigr
Replied by Tigr on topic TDCP_sha256 decode hash
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 (((((
Last edit: 4 months 46 minutes ago by Tigr.

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 months 28 minutes ago #11825 by Sternas Stefanos
Replied by Sternas Stefanos on topic TDCP_sha256 decode hash
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 ?

CodeTyphon Architect and Programmer

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

More
4 months 17 minutes ago #11826 by Tigr
Replied by Tigr on topic TDCP_sha256 decode hash
//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.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
4 months 9 minutes ago #11827 by Sternas Stefanos
Replied by Sternas Stefanos on topic TDCP_sha256 decode hash
Did you try to run your app with NO Debug info ?
a simple run ?

CodeTyphon Architect and Programmer

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

More
4 months 3 minutes ago #11828 by Tigr
Replied by Tigr on topic TDCP_sha256 decode hash
I run with Debug info

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
3 months 4 weeks ago #11829 by Sternas Stefanos
Replied by Sternas Stefanos on topic TDCP_sha256 decode hash
My suggestion is to
put your programs in a folder containing no spaces

CodeTyphon Architect and Programmer

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

More
3 months 4 weeks ago #11830 by Tigr
Replied by Tigr on topic TDCP_sha256 decode hash
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.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
3 months 4 weeks ago #11831 by Sternas Stefanos
Replied by Sternas Stefanos on topic TDCP_sha256 decode hash
Theoretically: NO
Practically: YES (if you delete,copy,insert, etc data)

CodeTyphon Architect and Programmer

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

More
3 months 4 weeks ago - 3 months 4 weeks ago #11832 by Tigr
Replied by Tigr on topic TDCP_sha256 decode hash
Do you have a better solution when working with big data?
Last edit: 3 months 4 weeks ago by Tigr.

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

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
3 months 4 weeks ago - 3 months 4 weeks ago #11833 by Sternas Stefanos
Replied by Sternas Stefanos on topic TDCP_sha256 decode hash
My Suggestion for
memory Big data, different from each other :
TObjectList info or TFPObjectList info

CodeTyphon Architect and Programmer
Last edit: 3 months 4 weeks ago by Sternas Stefanos.

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

More
3 months 4 weeks ago #11834 by Tigr
Replied by Tigr on topic TDCP_sha256 decode hash
Thanks!

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

More
3 months 4 weeks ago #11835 by Tigr
Replied by Tigr on topic TDCP_sha256 decode hash
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.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Away
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
3 months 4 weeks ago #11836 by Sternas Stefanos
Replied by Sternas Stefanos on topic TDCP_sha256 decode hash
Have fun Sir

CodeTyphon Architect and Programmer

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