/
githubmirror
/
screenshot-to-code
Обзор
Документация
Войти
/
githubmirror
/
screenshot-to-code
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
frontend/src/components/preview/simpleHash.ts
9 строк
251 B
Abi Raja
extract html to show a preview for video mode and switch to .srcdoc with throttling for the preview
08 мар 2024, 19:16
08 мар 2024, 19:16
caa6301
Код
Авторство
О чём код?
export function simpleHash(str: string, seed = 0) { let hash = seed; for (let i = 0; i < str.length; i++) { const char = str.charCodeAt(i); hash = (hash << 5) - hash + char; hash |= 0; // Convert to 32bit integer } return hash; }