Skip to content

Commit

Permalink
UUID Layout changed for later commits
Browse files Browse the repository at this point in the history
  • Loading branch information
0xSnowflakeXD committed Jan 25, 2024
1 parent 6e5c717 commit 3c082f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tcp-client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ const { stdin } = require("process")

function UUIDGen() {
let uuid = [,,,,]
uuid[0] = crypto.createHash("sha256").update(Date.now().toString()).digest("hex").toString().slice(0, 16)
uuid[1] = Buffer.from(crypto.randomBytes(8)).toString("hex").slice(0, 8)
uuid[2] = (Buffer.from("12c-").toString("hex").slice(1, 3) + crypto.createHash("sha256").update(crypto.randomBytes(8)).digest("hex").toString()).slice(0, 8)
uuid[0] = crypto.createHash("sha256").update(Date.now().toString()).digest("hex").toString().slice(0, 8)
uuid[1] = Buffer.from(crypto.randomBytes(8)).toString("hex").slice(0, 4)
uuid[2] = (Buffer.from("12c-").toString("hex").slice(1, 3) + crypto.createHash("sha256").update(crypto.randomBytes(8)).digest("hex").toString()).slice(0, 4)
uuid[3] = (crypto.createHash("sha512").update(Buffer.from(crypto.randomBytes(8))).digest("hex").toString().slice(1, 2) + Buffer.from(crypto.randomBytes(15)).toString("hex")).slice(0,16)
return uuid.join('-')
}
Expand Down

0 comments on commit 3c082f3

Please sign in to comment.