-
Notifications
You must be signed in to change notification settings - Fork 0
/
decode.js
19 lines (14 loc) · 747 Bytes
/
decode.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function traceid(){
const Crypto = require("crypto-js");
let n = Crypto && Crypto.getRandomValues ? ()=>Crypto.getRandomValues(new Uint8Array(1))[0] : ()=>16 * Math.random();
return "10000000100040008000100000000000".replace(/[018]/g, e=>(e ^ (15 & n()) >> e / 4).toString(16))}
// console.log(traceid(0))
function spanid(){
const Crypto = require("crypto-js");
let n = Crypto && Crypto.getRandomValues ? ()=>Crypto.getRandomValues(new Uint8Array(1))[0] : ()=>16 * Math.random();
return "10000000100040008000100000000000".replace(/[018]/g, e=>(e ^ (15 & n()) >> e / 4).toString(16)).substring(16)}
// console.log(spanid(0))
function Sentry_Trace(){
return traceid()+"-"+spanid()+"-0"
}
console.log(Sentry_Trace())