( macAddress: MacAddress, key: string = '', userId: number = 0 )
| 2 | import { md5 } from './md5.js'; |
| 3 | |
| 4 | export function computeDevicePassword( |
| 5 | macAddress: MacAddress, |
| 6 | key: string = '', |
| 7 | userId: number = 0 |
| 8 | ): string { |
| 9 | const hash = md5(`${macAddress}${key}`, 'hex'); |
| 10 | return `${userId}_${hash}`; |
| 11 | } |
| 12 | |
| 13 | export default computeDevicePassword; |
no test coverage detected