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

17
LINES

< > BotCompany Repo | #1017114 // signWithComputerIDAndDate

JavaX fragment (include)

sbool signWithComputerIDAndDate_verbose;
sbool signWithComputerIDAndDate_verify;

// appends a new line with computer id and signature
static S signWithComputerIDAndDate(S s, O... _) {
  bool verbose = optPar verbose(_, signWithComputerIDAndDate_verbose);
  S computerID = getComputerID();
  s = rtrim(s) + "\n\n" + "-" + computerID() + ", " + localDateWithMilliseconds() + " (" + localTimeZone().getDisplayName(false, TimeZone.SHORT) + ")";
  s = fromLines(toLines(s));
  if (verbose)
    print("Signing text: " + shorten(quote(s)));
  S signed = s + "sig: " + getMySignatureForText(s);
  signed = fromLines(toLines(signed));
  if (optPar verify(_, signWithComputerIDAndDate_verify))
    assertEqualsOptionalVerbose(verbose, "My own signature", computerID(), getAuthorOfSignedText(signed));
  ret signed;
}

Author comment

Began life as a copy of #1001566

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1017114
Snippet name: signWithComputerIDAndDate
Eternal ID of this version: #1017114/12
Text MD5: b03dab42b4c14e38d350a17e92b189cf
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-06-10 14:36:38
Source code size: 825 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 401 / 465
Version history: 11 change(s)
Referenced in: [show references]