MCPcopy
hub / github.com/r0ysue/r0capture / uuid

Function uuid

script.js:195–222  ·  view source on GitHub ↗
(len, radix)

Source from the content-addressed store, hash-verified

193
194if (Java.available) {
195 function uuid(len, radix) {
196 var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
197 var uuid = [], i;
198 radix = radix || chars.length;
199
200 if (len) {
201 // Compact form
202 for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random() * radix];
203 } else {
204 // rfc4122, version 4 form
205 var r;
206
207 // rfc4122 requires these characters
208 uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
209 uuid[14] = '4';
210
211 // Fill in random data. At i==19 set the high bits of clock sequence as
212 // per rfc4122, sec. 4.1.5
213 for (i = 0; i < 36; i++) {
214 if (!uuid[i]) {
215 r = 0 | Math.random() * 16;
216 uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
217 }
218 }
219 }
220
221 return uuid.join('');
222 }
223
224 function storeP12(pri, p7, p12Path, p12Password) {
225 var X509Certificate = Java.use("java.security.cert.X509Certificate")

Callers 1

script.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected