UNPKG

@astro-utils/forms

Version:

Server component for Astro (call server functions from client side with validation and state management)

9 lines (8 loc) 344 B
import { createHash } from "node:crypto"; export function createUniqueContinuanceName(func, length = 10) { const uniqueText = func.toString() + func.name; return hashString(uniqueText, length); } export function hashString(uniqueText, length = 10) { return createHash('md5').update(uniqueText).digest('hex').substring(0, length); }