mirror of
https://github.com/koush/scrypted.git
synced 2026-03-11 05:02:01 +00:00
* Allow setting the DEVADDR option * Fix intercom by using startRtpForwarderProcess() Clean up some dependencies * Allow logging errors in sip-manager Cleanup bloated and barely used dependencies
15 lines
352 B
TypeScript
15 lines
352 B
TypeScript
const crypto = require('crypto');
|
|
|
|
export function generateUuid(seed?: string) {
|
|
return crypto.randomUUID();
|
|
}
|
|
|
|
export function randomInteger() {
|
|
return Math.floor(Math.random() * 99999999) + 100000
|
|
}
|
|
|
|
export function randomString(length: number) {
|
|
const uuid = generateUuid()
|
|
return uuid.replace(/-/g, '').substring(0, length).toLowerCase()
|
|
}
|