mirror of
https://github.com/svemagie/indiekit-endpoint-microsub.git
synced 2026-04-02 15:35:00 +02:00
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>
18 lines
412 B
JavaScript
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;
|
|
}
|