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

21
LINES

< > BotCompany Repo | #1023316 // Assistant User Passwords

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (2244L/13K).

!7

cmodule AssistantUserPasswords > DynPrintLog {
  start {
    logModuleOutput();
    print("Have " + n2(countFilesInDir(assistants_pwDir()), "password"));
  }
  
  // API
  
  void savePassword(S userID, S hash) {
    printWithDate("CHANGING password for " + userID);
    saveTextFile(assistants_pwHashFile(userID), assertSHA256(hash));
  }
  
  bool checkPassword(S userID, S hash) {
    bool result = eq(trim(loadTextFile(assistants_pwHashFile(userID))), hash);
    printWithDate("CHECKING password for " + userID + " => " + result);
    ret result;
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1023316
Snippet name: Assistant User Passwords
Eternal ID of this version: #1023316/5
Text MD5: c584f937bcaa2b28b5e7c980b1f7e32c
Transpilation MD5: d37ac1f8b6d3850c846026960dc084fd
Author: stefan
Category: javax / assistants
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-06-07 10:17:06
Source code size: 580 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 268 / 9536
Version history: 4 change(s)
Referenced in: #1023334 - dm_assistant_passwordsCRUD