digitalmars.D - [your code here]
- greenbyte (15/15) Jun 20 2022 Random alphanumeric string
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;
}
```
Jun 20 2022








greenbyte <lysenko765 yandex.ru>