I am trying to find some code which will allow me to generate a RANDOM string of characters. I am really aiming to write a password generator but cannot find how to create a RANDOM string generator...
ANY help would be great and very much appreciated.
function RandString(const stringsize: integer): string;
var
n: integer;
s: string;
const ss: string = '0123456789abc';
{list all the charcaters you want to use}
begin
s:='';
for n:=1 to stringsize do
s:=s+ss[random(length(ss))+1];
RandString:=s;
end;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.