Raised This Month: $51 Target: $400
 12% 

[INC] is_str_md5


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
WiggPerson
Junior Member
Join Date: Dec 2013
Location: Slovakia
Old 12-07-2013 , 02:28   [INC] is_str_md5
Reply With Quote #1

Hello, i want to share my .inc library function which check string if is hashed in MD5 keysum. It can be very useful at securing your server.

Usage:

PHP Code:
/*    Check if string is hashed in MD5 keysum
*
*    @parameter string[] - String, which you want to check
*    @return - 1 = Yes, string is in MD5 0 = No, string is not in MD5
*/
stock is_str_m5d(const string[]) 
I tested it myself and it 100% works.

NOTE: If you have problem with compiling, then remove #include <regex> in you script.
Attached Files
File Type: inc is_str_md5.inc (487 Bytes, 281 views)
WiggPerson is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-07-2013 , 03:09   Re: [INC] is_str_md5
Reply With Quote #2

Thanks, i think that since you don't use error string, you could lower its size :

PHP Code:
stock bool:is_str_md5(const string[]) {
    new 
iErrorszError[1];
    return 
regex_match(string"^^[a-f0-9]{32}$"iErrorszErrorcharsmax(szError), "i") == REGEX_OK;

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-07-2013 at 03:10.
ConnorMcLeod is offline
WiggPerson
Junior Member
Join Date: Dec 2013
Location: Slovakia
Old 12-07-2013 , 03:33   Re: [INC] is_str_md5
Reply With Quote #3

Thanks for advice ConnnorMcLeod, I am still just learning this language.
__________________
It does not matter who you are, just who you become.
WiggPerson 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 08:08.


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