Results 1 to 10 of 23

Thread: Files for extended Server + Random-Scripts like sliding mapvote on Deathrun

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #22
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by kung foo man View Post
    MySQL does that for you

    PHP Code:
    SELECT md5('test'
    Thanks. I have been looking into mysql's security functions. It is safer to use SHA2.

    PHP Code:
    DELIMITER $$

    DROP FUNCTION IF EXISTS generateSalt$$

    CREATE FUNCTION generateSalt()
    RETURNS VARCHAR(255)
    DETERMINISTIC
    BEGIN
        
    DECLARE x INT;
        DECLARE 
    s VARCHAR(255);
        
    SET s '';
        
    SET x 0;

        WHILE 
    x  10 DO
            
    SET s CONCAT(s,CHAR(FLOOR(34+(RAND()*93))));
            
    SET x 1
        
    END WHILE;

        RETURN 
    s;
    END$$

    DELIMITER 
    PHP Code:
    SET s generateSalt();
    SET pass SHA2(CONCAT(spass), 256); 
    Last edited by Mitch; 20th May 2013 at 12:09.

  2. The Following User Says Thank You to Mitch For This Useful Post:

    kung foo man (20th May 2013)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •