forked from node-pcap/node_pcap
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutil.js
More file actions
Latest commit
20 lines (17 loc) · 457 Bytes
/
Copy pathutil.js
File metadata and controls
20 lines (17 loc) · 457 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
functionlpad(str,len){
while(str.length<len){
str="0"+str;
}
returnstr;
}
varint8_to_hex=[];
varint8_to_hex_nopad=[];
varint8_to_dec=[];
for(vari=0;i<=255;i++){
int8_to_hex[i]=lpad(i.toString(16),2);
int8_to_hex_nopad[i]=i.toString(16);
int8_to_dec[i]=i.toString();
}
exports.int8_to_dec=int8_to_dec;
exports.int8_to_hex=int8_to_hex;
exports.int8_to_hex_nopad=int8_to_hex_nopad;