mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
22 lines
456 B
TypeScript
22 lines
456 B
TypeScript
import crypto from 'node:crypto';
|
|
import { resolve } from 'dns';
|
|
|
|
export function sleep(ms: number): Promise<void> {
|
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
}
|
|
|
|
export function getMd5(s: string) {
|
|
|
|
const h = crypto.createHash('md5');
|
|
h.update(s);
|
|
return h.digest('hex');
|
|
}
|
|
|
|
export function isNull(value: any) {
|
|
return value === undefined || value === null;
|
|
}
|
|
|
|
export function isNumeric(str: string) {
|
|
return /^\d+$/.test(str);
|
|
}
|