import { LOCALSTORAGE_KEY_BROWSER_UUID } from '@/constants/localStorageKeys'

export function getBrowserUuid(): string {
  let browserUuid = localStorage.getItem(LOCALSTORAGE_KEY_BROWSER_UUID)
  if (!browserUuid) {
    browserUuid = crypto.randomUUID() // Браузерная API для генерации UUID
    localStorage.setItem(LOCALSTORAGE_KEY_BROWSER_UUID, browserUuid)
  }
  return browserUuid
}
