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)

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

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: 674 / 914
Version history: 3 change(s)
Referenced in: [show references]