Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
MR414N-ID
GitHub Repository: MR414N-ID/botku2
Path: blob/master/node_modules/@adiwajshing/baileys/WASignalGroup/keyhelper.js
1126 views
1
const curve = require('libsignal/src/curve');
2
const nodeCrypto = require('crypto');
3
4
exports.generateSenderKey = function() {
5
return nodeCrypto.randomBytes(32);
6
}
7
8
exports.generateSenderKeyId = function() {
9
return nodeCrypto.randomInt(2147483647);
10
}
11
12
exports.generateSenderSigningKey = function(key) {
13
if (!key) {
14
key = curve.generateKeyPair();
15
}
16
17
return {
18
public: key.pubKey,
19
private: key.privKey,
20
};
21
}
22
23