Raised This Month: $32 Target: $400
 8% 

How to fix - warning 233: symbol md5


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fum77
Junior Member
Join Date: May 2020
Location: Bournemouth (UK)
Old 05-25-2020 , 10:00   How to fix - warning 233: symbol md5
Reply With Quote #1

Hi guys. Today I've tried to compile an older plugin with the Compiler 1.9.0.5249.
I got an error that I don't know how to fix.
The error line: warning 233: symbol "md5" is marked as deprecated: Use hash_string() function. Also, see Hash_* constants.
And this is the cod from the sma

PHP Code:
stock convert_password(const password[])
{
    new 
pass_salt[64], converted_password[34];

    
formatex(pass_saltcharsmax(pass_salt), "%s%s"passwordSALT)
    
md5(pass_saltconverted_password)
    
    return 
converted_password


I want to thank you in advance for any information or help.
I hope you are all well in this period we are going through.
#stayathome #besafe
fum77 is offline
Send a message via Skype™ to fum77
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-25-2020 , 10:10   Re: How to fix - warning 233: symbol md5
Reply With Quote #2

It's not an error, it's a warning and the code still compiled fine. You have an explanation on how to fix it in the warning itself.

Deprecation warnings mean that there is better new alternative for the functions used inside the code. In this case "hash_string" is a better alternative for the old "md5" function.
__________________

Last edited by OciXCrom; 05-25-2020 at 10:11.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
fum77
Junior Member
Join Date: May 2020
Location: Bournemouth (UK)
Old 05-25-2020 , 10:29   Re: How to fix - warning 233: symbol md5
Reply With Quote #3

Thank you so much for your fast reply to my post.
I made that change when I first get the "warning"

PHP Code:
stock convert_password(const password[])
{
    new 
pass_salt[64], converted_password[34];

    
formatex(pass_saltcharsmax(pass_salt), "%s%s"passwordSALT)
    
hash_string(pass_saltconverted_password)
    
    return 
converted_password

Now I get an error
RegisterSystem.sma(2781) : error 035: argument type mismatch (argument 2)

Can you pls make this change for me on an example code?
I'm sure hash_string is not write how it has to be.

Thank you again.
fum77 is offline
Send a message via Skype™ to fum77
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 05-25-2020 , 11:03   Re: How to fix - warning 233: symbol md5
Reply With Quote #4

Checking the API I believe it is this way, I have not tested it.

PHP Code:
stock convert_password(const password[])
{
    new 
pass_salt[64], converted_password[34];

    
formatex(pass_saltcharsmax(pass_salt), "%s%s"passwordSALT)
    
hash_string(pass_saltHash_Md5converted_passwordcharsmax(converted_password))

    return 
converted_password

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
fum77
Junior Member
Join Date: May 2020
Location: Bournemouth (UK)
Old 05-25-2020 , 11:22   Re: How to fix - warning 233: symbol md5
Reply With Quote #5

.Done
That was the right way to write the code.
Thank you so much iceeedr and OciXChrom
Take care!
fum77 is offline
Send a message via Skype™ to fum77
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-25-2020 , 14:01   Re: How to fix - warning 233: symbol md5
Reply With Quote #6

You should read the documentation for the new function before you use it because a deprecated function isn't always replaced by an exact duplicate (which would make no sens and the function wouldn't be deprecated).
__________________

Last edited by fysiks; 05-25-2020 at 14:02.
fysiks is offline
fum77
Junior Member
Join Date: May 2020
Location: Bournemouth (UK)
Old 05-25-2020 , 16:13   Re: How to fix - warning 233: symbol md5
Reply With Quote #7

Quote:
Originally Posted by fysiks View Post
You should read the documentation for the new function before you use it because a deprecated function isn't always replaced by an exact duplicate (which would make no sens and the function wouldn't be deprecated).
I already read the documentation before the post but I don't understand much of what it says there. I don't know the pawn language but I want to learn it for the future. From long time I was thinking on learn how to create my own plugins. But I never done it.
Thanks for the advice I will keep that in mind.
Take care fysiks
fum77 is offline
Send a message via Skype™ to fum77
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-25-2020 , 19:16   Re: How to fix - warning 233: symbol md5
Reply With Quote #8

If you didn't understand it, let us know so we can help you learn it. Also, showing that you're actually putting in some effort will help build your credibility around here. Saying "do this for me" is the worst thing that a person can say in the Scripting Help section.
__________________
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode