Skip to content

签名验证

typescript
import crypto from 'crypto';

function verifySignature(body: string, timestamp: string, appId: string, signature: string, appSecret: string): boolean {
  const expected = crypto.createHash('md5').update(body + timestamp + appSecret).digest('hex');
  return expected === signature;
}