mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 00:46:01 +00:00
10 lines
252 B
JavaScript
10 lines
252 B
JavaScript
const crypto = require('crypto');
|
|
|
|
function timingSafeCheckToken(a, b) {
|
|
if (!a || !b) return false;
|
|
if (a.length != b.length) return false;
|
|
return crypto.timingSafeEqual(Buffer.from(a), Buffer.from(b));
|
|
}
|
|
|
|
module.exports = timingSafeCheckToken;
|