Files
indiekit-endpoint-microsub/lib/utils/uid.js
Ricardo 30f9939b3a feat: initial commit - Microsub endpoint for Indiekit
Fork of @indiekit/endpoint-microsub with customizations.
Enables subscribing to feeds and reading content using the Microsub protocol.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 16:32:55 +01:00

18 lines
412 B
JavaScript

/**
* UID generation utilities for Microsub
* @module utils/uid
*/
/**
* Generate a random channel UID
* @returns {string} 24-character random string
*/
export function generateChannelUid() {
const chars = "abcdefghijklmnopqrstuvwxyz0123456789";
let result = "";
for (let index = 0; index < 24; index++) {
result += chars.charAt(Math.floor(Math.random() * chars.length));
}
return result;
}