Using UUIDv4 instead of random 64 hex-char string for instance nonce #1560

Closed
opened 2026-04-05 17:51:28 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @Fusl on 9/23/2019

VRChat itself uses UUIDv4's to create instance nonces while VRCX uses a random 64 hex-char string. Instead, VRCX should be using UUIDv4 strings as well to make VRCX-created worlds less distinguishable from non-VRCX created ones.

UUIDv4 generation function

function uuidv4() {
  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
    var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
    return v.toString(16);
  });
}

doesn't use any of the fancy new ES or Node.js stuff, so replacing

var nonce = [];
for (var i = 0; i < 10; ++i) {
    nonce.push(Math.random().toString(16).substr(2).toUpperCase());
}
nonce = nonce.join('').substr(0, 64);

with

var nonce = uuidv4();

should just work out of the box (however, I haven't tested it).

*Originally created by @Fusl on 9/23/2019* VRChat itself uses UUIDv4's to create instance nonces while VRCX uses a random 64 hex-char string. Instead, VRCX should be using UUIDv4 strings as well to make VRCX-created worlds less distinguishable from non-VRCX created ones. UUIDv4 generation function ``` function uuidv4() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); } ``` doesn't use any of the fancy new ES or Node.js stuff, so replacing ``` var nonce = []; for (var i = 0; i < 10; ++i) { nonce.push(Math.random().toString(16).substr(2).toUpperCase()); } nonce = nonce.join('').substr(0, 64); ``` with ``` var nonce = uuidv4(); ``` should just work out of the box (however, I haven't tested it).
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/VRCX#1560