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).

1  
!7
2  
3  
cmodule AssistantUserPasswords > DynPrintLog {
4  
  start {
5  
    logModuleOutput();
6  
    print("Have " + n2(countFilesInDir(assistants_pwDir()), "password"));
7  
  }
8  
  
9  
  // API
10  
  
11  
  void savePassword(S userID, S hash) {
12  
    printWithDate("CHANGING password for " + userID);
13  
    saveTextFile(assistants_pwHashFile(userID), assertSHA256(hash));
14  
  }
15  
  
16  
  bool checkPassword(S userID, S hash) {
17  
    bool result = eq(trim(loadTextFile(assistants_pwHashFile(userID))), hash);
18  
    printWithDate("CHECKING password for " + userID + " => " + result);
19  
    ret result;
20  
  }
21  
}

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: 269 / 9537
Version history: 4 change(s)
Referenced in: [show references]