How to use the ref-napi.types.int32 function in ref-napi

To help you get started, we’ve selected a few ref-napi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github symphonyoss / SymphonyElectron / src / app / crypto-handler.ts View on Github external
const TAG_LENGTH = 16;
const arch = process.arch === 'ia32';
const winLibraryPath = isDevEnv ? path.join(__dirname, '..', '..', 'library') : path.join(execPath, 'library');
const macLibraryPath = isDevEnv ? path.join(__dirname, '..', '..', '..', 'library') : path.join(execPath, '..', 'library');

const cryptoLibPath = isMac ?
    path.join(macLibraryPath, 'cryptoLib.dylib') :
    (arch ? path.join(winLibraryPath, 'libsymphonysearch-x86.dll') : path.join(winLibraryPath, 'libsymphonysearch-x64.dll'));

const library = new Library((cryptoLibPath), {
    AESEncryptGCM: [types.int32, [
        refType(types.uchar),
        types.int32,
        refType(types.uchar),
        types.int32,
        refType(types.uchar),
        refType(types.uchar),
        types.uint32,
        refType(types.uchar),
        refType(types.uchar),
        types.uint32,
    ]],

    AESDecryptGCM: [types.int32, [
        refType(types.uchar),
        types.int32,
        refType(types.uchar),
        types.int32,
        refType(types.uchar),
        types.uint32,
        refType(types.uchar),