mirror of
https://github.com/xtr-dev/rondevu-demo.git
synced 2025-12-09 18:33:23 +00:00
Change connection ID generation to exclude ambiguous characters
- Replace hex-based generation with a new random alphanumeric system - Generated IDs exclude visually similar characters (e.g., 'o', '0', 'I', 'l')
This commit is contained in:
@@ -26,9 +26,14 @@ const client = new RondevuClient({
|
||||
baseUrl: 'https://rondevu.xtrdev.workers.dev'
|
||||
});
|
||||
|
||||
// Generate a random 6-digit hex string
|
||||
// Generate a random 6-digit string
|
||||
function generateConnectionId() {
|
||||
return Math.floor(Math.random() * 0xFFFFFF).toString(16).padStart(6, '0').toUpperCase();
|
||||
const chars = '23456789abcdefghjkmnopqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ';
|
||||
let id = '';
|
||||
for (let i = 0; i < 6; i++) {
|
||||
id += chars.charAt(Math.floor(Math.random() * chars.length));
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
function App() {
|
||||
|
||||
Reference in New Issue
Block a user