mirror of
https://github.com/immich-app/immich
synced 2026-08-29 13:15:45 +00:00
17 lines
552 B
JavaScript
17 lines
552 B
JavaScript
// Server-side roundtrip: load the napi addon and call into the shared core.
|
|
import { createRequire } from 'node:module';
|
|
|
|
const require = createRequire(import.meta.url);
|
|
const core = require('./immich_core_napi.node');
|
|
|
|
const version = core.coreVersion();
|
|
console.log(`NAPI core_version = ${version}`);
|
|
|
|
const hash = core.sha1Hex(Buffer.from('abc'));
|
|
console.log(`NAPI sha1Hex("abc") = ${hash}`);
|
|
|
|
if (hash !== 'a9993e364706816aba3e25717850c26c9cd0d89d') {
|
|
console.error('NAPI sha1 mismatch');
|
|
process.exit(1);
|
|
}
|
|
console.log('NAPI roundtrip OK');
|