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

19
LINES

< > BotCompany Repo | #1000568 - computerID - get (and optionally create) computer's ID

JavaX fragment (include)

static String _computerID;
static Lock computerID_lock = lock();

public static String computerID() {
  if (_computerID == null) {
    lock computerID_lock;
    if (_computerID != null) ret _computerID;
    File file = computerIDFile();
    _computerID = loadTextFile(file.getPath());
    if (_computerID == null) {
      // legacy load
      _computerID = loadTextFile(userDir(".tinybrain/computer-id"));
      if (_computerID == null)
        _computerID = makeRandomID(12, new SecureRandom);
      saveTextFile(file, _computerID);
    }
  }
  ret _computerID;
}

download  show line numbers  debug dex   

Travelled to 14 computer(s): aoiabmzegqzx, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, jtubtzbbkimh, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, sawdedvomwva, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1000568
Snippet name: computerID - get (and optionally create) computer's ID
Eternal ID of this version: #1000568/10
Text MD5: 922e9293acc3f5345da2f3e283aa541b
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-22 12:42:54
Source code size: 582 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 528 / 3431
Version history: 9 change(s)
Referenced in: [show references]

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