Jump to content

librhash


ADMPV
 Share

Recommended Posts

https://sourceforge.net/projects/rhash/

librhash.dll - supports CRC32, MD4, MD5, SHA1, SHA256, SHA512, SHA3, Tiger, TTH, Torrent BTIH, AICH, ED2K, GOST R 34.11-94, RIPEMD-160, HAS-160, EDON-R 256/512, WHIRLPOOL and SNEFRU hash sums.

faster than _Crypt_HashFile about 2 times

librhash.au3, librhash.dll in archive

Changelog:

        2017-07-11 Added: rhash_timer_start, rhash_timer_stop
                   Changed: DLL - rhash_run_benchmark_mod - passing file as HANDLE
        2017-07-07 Changed: rhash_ex()
                   Added: DLL - rhash_run_benchmark_mod
        2017-07-04 Changed rhash_ex()

 

librhash_134.zip

Edited by ADMPV
Link to comment
Share on other sites

Thanks for sharing this. Could you add an Enum for the hash_id ?, it'll make it easier to use. 
 

rhash_ex()
Func rhash_ex()

    Local $hash_id = $RHASH_MD5

    rhash_library_init()

    MsgBox(262144, "rhash_get_hash_length", rhash_get_hash_length($hash_id))
    MsgBox(262144, "rhash_file", rhash_file($hash_id, 'librhash.dll'))
    MsgBox(262144, "rhash_count", rhash_count())
    MsgBox(262144, "rhash_get_digest_size", rhash_get_digest_size($hash_id))
    MsgBox(262144, "rhash_get_name", rhash_get_name($hash_id))

    Local $file = FileOpen("librhash.dll", 16)
    MsgBox(262144, "rhash_msg", rhash_msg($hash_id, FileRead($file)))

EndFunc   ;==>rhash_ex

Yep,  I did not understand the example.

Edited by argumentum
correct myself

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

; #FUNCTION# ====================================================================================================================
; RHASH_API Example
; md5(librhash.dll) = 0x3A11F6C700A5903CEB104C4971DCB3A1
; ===============================================================================================================================
Func rhash_ex()

  Local $hash_id = $RHASH_WHIRLPOOL
  Local $s, $file

  rhash_library_init()

  $s  = "rhash_count = " & rhash_count() & @CRLF
  $s &= "$hash_id = " & $hash_id & @CRLF
  $s &= "rhash_get_name = " & rhash_get_name($hash_id) & @CRLF
  $s &= "rhash_get_hash_length = " & rhash_get_hash_length($hash_id) & @CRLF
  $s &= "rhash_get_digest_size = " & rhash_get_digest_size($hash_id) & @CRLF
  $s &= "rhash_file = " & rhash_file($hash_id, 'librhash.dll') & @CRLF
  $file = FileOpen("librhash.dll", 16)
  $s &= "rhash_msg = " & rhash_msg($hash_id, FileRead($file)) & @CRLF

  MsgBox(0, "rhash", $s)

EndFunc   ;==>rhash_ex

; Uncomment next line to run example
rhash_ex()

 

Link to comment
Share on other sites

Intel(R) Pentium(R) D CPU 3.40GHz + 3Gb RAM

CRC32 2048 MiB total in 3.887 sec, 526.917 MBps
MD4 2048 MiB total in 2.221 sec, 922.157 MBps
MD5 2048 MiB total in 3.543 sec, 578.038 MBps
SHA1 2048 MiB total in 13.992 sec, 146.369 MBps
TIGER 2048 MiB total in 26.988 sec, 75.887 MBps
TTH 2048 MiB total in 31.240 sec, 65.557 MBps
BTIH 2048 MiB total in 14.107 sec, 145.174 MBps
ED2K 2048 MiB total in 2.250 sec, 910.213 MBps
AICH 2048 MiB total in 14.123 sec, 145.015 MBps
WHIRLPOOL 256 MiB total in 12.197 sec, 20.990 MBps
RIPEMD-160 2048 MiB total in 9.321 sec, 219.711 MBps
GOST 1024 MiB total in 20.129 sec, 50.871 MBps
GOST-CRYPTOPRO 1024 MiB total in 20.204 sec, 50.684 MBps
HAS-160 2048 MiB total in 4.539 sec, 451.199 MBps
SNEFRU-128 256 MiB total in 8.305 sec, 30.825 MBps
SNEFRU-256 256 MiB total in 12.088 sec, 21.177 MBps
SHA-224 2048 MiB total in 22.861 sec, 89.586 MBps
SHA-256 2048 MiB total in 22.931 sec, 89.313 MBps
SHA-384 1024 MiB total in 62.102 sec, 16.489 MBps
SHA-512 1024 MiB total in 62.488 sec, 16.387 MBps
EDON-R256 2048 MiB total in 6.897 sec, 296.931 MBps
EDON-R512 2048 MiB total in 20.182 sec, 101.475 MBps
SHA3-224 256 MiB total in 10.994 sec, 23.285 MBps
SHA3-256 256 MiB total in 11.782 sec, 21.727 MBps
SHA3-384 256 MiB total in 15.198 sec, 16.845 MBps
SHA3-512 256 MiB total in 22.180 sec, 11.542 MBps

 

Link to comment
Share on other sites

  • 2 years later...

Hello.

Interested in calling some functions on the updated library  librhash.dll.

https://sourceforge.net/projects/rhash/files/rhash/1.3.8/

TTH, BTIH, AICH, and and magnet links generation do not work in this script librhash.au3

https://www.datafilehost.com/d/782a0a5d

Can someone help with this script?

Thank you in advance.

 

Link to comment
Share on other sites

On 7/4/2017 at 7:42 AM, ADMPV said:

maybe someone know how to pass FILE* to C++ dll

RHASH_API void rhash_run_benchmark(unsigned hash_id, unsigned flags, FILE* output);

"handle" crashes

Did you try 'handle*' ?

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...