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

11
LINES

< > BotCompany Repo | #1001584 // unsign - drop author line & signature from signed message

JavaX fragment (include)

static S unsign(S s) {
  try {
    L<S> lines = toLines(s);
    S sigLine = lines.get(lines.size()-1);
    if (!sigLine.startsWith("sig: "))
      ret s;
    ret fromLines(lines.subList(0, lines.size()-2));
  } catch (RuntimeException e) {
    ret s;
  }
}

Author comment

Began life as a copy of #1001583

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: #1001584
Snippet name: unsign - drop author line & signature from signed message
Eternal ID of this version: #1001584/4
Text MD5: fab8a4983e36b88526a397f028ac3841
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-07-12 17:36:17
Source code size: 266 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 671 / 909
Version history: 3 change(s)
Referenced in: [show references]