Version 0 of Password generator

Updated 2016-04-15 11:07:53 by paskali

Should create a strong password:

variable _index [pid];

proc password {length} {
        global _index;
        variable _set {shW4UMe832TpaSylIdfzxbrNki9A7Q5PmZ0XDuYVg1KEGwLcJtjRCF6OqovBHn};
        variable _password {};

        for {set _char 1} {$_char <= $length} {incr _char} {
                incr _index [lindex [time {
                        while {$_index >= [string length $_set]} {
                                incr _index -[string length $_set];
                        }
                        
                        # Only usefull to increase entrophy
                        
                        for {set _count $_index} {$_count <= [string length $_set]} {incr _count} {
                        
                                # Nothing to do

                        }
                        
                        set _password $_password[string index $_set $_index];
                }] 0]
        }

        return $_password;
}

Call password length inside the script.