Page 2 of 2

Re: hash() function - 2022/01/28 - beta.3

Posted: 01 Feb 2022, 05:21
by jNizM
Try this: viewtopic.php?f=83&t=96117
till I found his mistake ;)

Re: hash() function - 2022/01/28 - beta.3

Posted: 01 Feb 2022, 05:23
by TheArkive
Probably utf16 vs utf8

Re: hash() function - 2022/01/28 - beta.3

Posted: 01 Feb 2022, 05:25
by jNizM
Change LBuf.size to LBuf.size - 1 and use the right encoding (UTF-8)

And the 4GB limit is because the function reads the complete file into memory.
For larger files the function should be changed to (like) this: https://github.com/jNizM/AHK_CNG/blob/master/src/Class_CNG.ahk#L380-L394

Re: hash() function - 2022/01/28 - beta.3

Posted: 01 Feb 2022, 05:53
by TheArkive
Cool thanks. I'll make those changes.

It would be LBuf.size - 2 for utf16 right?

Re: hash() function - 2022/02/02 - beta.3

Posted: 01 Feb 2022, 18:34
by TheArkive
2022/02/02
  • chanaged parameters, added chunk size and callback
  • updated example
  • file is now read per c_size in order to support files over 4GB
  • use callback to monitor progress, callback accepts one param (float)
  • now only UTF-8 is used to hash text
  • input item must be VarRef now
  • updated readme
Thanks @jNizM for the suggestions.

Re: hash() function - 2022/02/02 - beta.3

Posted: 01 Jun 2022, 04:15
by midodds
Hi

Hoping you will be able to help with this error. The error only occurs when running as an exe not as a script

I call the CNG function from the script like this ....... if (Hash.String("SHA1", Password) =

The CNG cript has been added to the end of my script and starts from "class Hash extends CNG"

Mike

Re: hash() function - 2022/02/02 - beta.3

Posted: 01 Jun 2022, 04:59
by TheArkive
You use this func and the CNG class from jNizM? I don't recommend that. You don't need the hash() func if you use the CNG lib.

Edit: it looks like you might be mixing versions too. Are you using AHK v1 or v2?