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

14
LINES

< > BotCompany Repo | #1013838 // hjs_hexencode

JavaX fragment (include)

1  
sS hjs_hexencode() {
2  
  ret hjavascript([[
3  
  String.prototype.hexencode = function(){
4  
    var hex, i;
5  
6  
    var result = "";
7  
    for (i=0; i<this.length; i++) {
8  
        hex = this.charCodeAt(i).toString(16);
9  
        result += ("000"+hex).slice(-4);
10  
    }
11  
12  
    return result
13  
}]]);
14  
}

Author comment

Began life as a copy of #1013837

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1013838
Snippet name: hjs_hexencode
Eternal ID of this version: #1013838/1
Text MD5: 4c66bcaf77ffb80c206ea7f63906c02d
Author: stefan
Category: javax / web
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-03-05 14:41:34
Source code size: 292 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 404 / 416
Referenced in: [show references]