UNPKG

canoejs

Version:

A lightweight, widget-based UI framework

14 lines (11 loc) 433 B
// Hash function simple y rápida para reemplazar SHA256 export default function hashString(input: string): string { let hash = 0; if (input.length === 0) return hash.toString(); for (let i = 0; i < input.length; i++) { const char = input.charCodeAt(i); hash = ((hash << 5) - hash) + char; hash = hash & hash; // Convert to 32bit integer } return hash.toString(); }