UNPKG

homebridge-ring

Version:

Homebridge plugin for Ring doorbells, cameras, security alarm system and smart lighting

9 lines (8 loc) 276 B
import { createHash } from 'crypto'; export function generateMacAddress(uuid) { const sha1sum = createHash('sha1'); sha1sum.update(uuid); const s = sha1sum.digest('hex'); let i = 0; return 'xx:xx:xx:xx:xx:xx'.replace(/[x]/g, () => s[i++]).toUpperCase(); }