|
PowerBASIC Forums
![]() Programming
![]() ElfHash c translation
|
| next newest topic | next oldest topic |
| Author | Topic: ElfHash c translation |
|
Brad McLane Member |
I am struggling with the translation of the ElfHash() function from c to PB. Here's the c code:
Now I know why I've always found excuses not to code in c: Too many cryptic operators! Here's my best hack at a PB translation:
The PB code runs but it always returns zero. Anyone have any suggestions?
------------------ IP: Logged |
|
Dave Navarro Member |
quote: Here's my translation...
--Dave ------------------ IP: Logged |
|
Brad McLane Member |
That one works much better. Thanks Dave! ------------------ IP: Logged |
|
Wayne Diamond Member |
Dave, Your port produces incorrect results, and unfortunately it has gone unnoticed for one and a half years ![]() But better late than never! Here's a fixed one: FUNCTION Elf32(sKey AS STRING) AS LONG And here's my inline port: FUNCTION Elf32(sKey AS STRING) AS DWORD See also http://www.wanet.com.au/~diamond/pbcrypto/view.php?algorithm=elf32 ------------------ [This message has been edited by Wayne Diamond (edited July 24, 2002).] IP: Logged |
All times are EasternTime (US) | next newest topic | next oldest topic |
![]() |
|
Copyright © 1999-2005 PowerBASIC, Inc. All Rights Reserved.