n8n-nodes-feishu-lark
Version:
n8n custom nodes for n8n to interact with Feishu/Lark, including Lark Bot, Lark MCP, and Lark Trigger.
23 lines • 913 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AESCipher = void 0;
const crypto_1 = __importDefault(require("crypto"));
class AESCipher {
constructor(key) {
const hash = crypto_1.default.createHash('sha256');
hash.update(key);
this.key = hash.digest();
}
decrypt(encrypt) {
const encryptBuffer = Buffer.from(encrypt, 'base64');
const decipher = crypto_1.default.createDecipheriv('aes-256-cbc', this.key, encryptBuffer.subarray(0, 16));
let decrypted = decipher.update(encryptBuffer.subarray(16).toString('hex'), 'hex', 'utf8');
decrypted += decipher.final('utf8');
return decrypted;
}
}
exports.AESCipher = AESCipher;
//# sourceMappingURL=aes-cipher.js.map