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

14
LINES

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

JavaX fragment (include)

static String makeRandomID(int length) {
  ret makeRandomID(length, defaultRandomGenerator());
}

static String makeRandomID(int length, Random random) {
  char[] id = new char[length];
  for (int i = 0; i < id.length; i++)
    id[i] = (char) ((int) 'a' + random.nextInt(26));
  return new String(id);
}

sS makeRandomID(Random r, int length) {
  ret makeRandomID(length, r);
}

download  show line numbers  debug dex   

Travelled to 18 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vujiipfktnfq, 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: 411 / 4928
Version history: 2 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1000570 & http://1000570.tinybrain.de