forked from snyk-labs/nodejs-goof
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.js
More file actions
Latest commit
28 lines (22 loc) · 641 Bytes
/
Copy pathutils.js
File metadata and controls
28 lines (22 loc) · 641 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module.exports={
ran_no : function(min,max){
returnMath.floor(Math.random()*(max-min+1))+min;
},
uid : function(len){
varstr='';
varsrc='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
varsrc_len=src.length;
vari=len;
for(;i--;){
str+=src.charAt(this.ran_no(0,src_len-1));
}
returnstr;
},
forbidden : function(res){
varbody='Forbidden';
res.statusCode=403;
res.setHeader('Content-Type','text/plain');
res.setHeader('Content-Length',body.length);
res.end(body);
}
};