Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

14
LINES

< > BotCompany Repo | #1000570 // makeRandomID(int)

JavaX fragment (include)

1  
static String makeRandomID(int length) {
2  
  ret makeRandomID(length, defaultRandomGenerator());
3  
}
4  
5  
static String makeRandomID(int length, Random random) {
6  
  char[] id = new char[length];
7  
  for (int i = 0; i < id.length; i++)
8  
    id[i] = (char) ((int) 'a' + random.nextInt(26));
9  
  return new String(id);
10  
}
11  
12  
sS makeRandomID(Random r, int length) {
13  
  ret makeRandomID(length, r);
14  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 23 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, ekrmjmnbrukm, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt, vujiipfktnfq, wnsclhtenguj, xprdwmaupziu, xrpafgyirdlv

No comments. add comment

Snippet ID: #1000570
Snippet name: makeRandomID(int)
Eternal ID of this version: #1000570/3
Text MD5: 542e4aeefab2bed87d8dd429c5521a90
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-12 12:56:46
Source code size: 390 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 787 / 5401
Version history: 2 change(s)
Referenced in: [show references]