[your code here]
greenbyte
lysenko765 at yandex.ru
Mon Jun 20 11:56:31 UTC 2022
Random alphanumeric string
```d
string randomAlphanumericString(int length)
{
import std.array : array;
import std.ascii : letters, digits;
import std.random : choice, Random, unpredictableSeed;
import std.range : generate, take;
import std.conv : to;
auto rnd = Random(unpredictableSeed);
auto symbols = array(letters ~ digits);
return generate!({ return symbols.choice(rnd);
}).take(length).to!string;
}
```
More information about the Digitalmars-d
mailing list