This commit is contained in:
Manav Rathi
2024-06-26 19:03:54 +05:30
parent c4b93019d5
commit d5d7efd657
3 changed files with 11 additions and 3 deletions

View File

@@ -73,9 +73,8 @@ const RemoteEmbedding = z.object({
type RemoteEmbedding = z.infer<typeof RemoteEmbedding>;
/**
* Ask remote for what all changes have happened to the face embeddings that it
* knows about since the last time we synced. Update our local state to reflect
* those changes.
* Fetch new or updated face embeddings with the server and save them locally.
* Also prune local embeddings for any files no longer exist locally.
*
* It takes no parameters since it saves the last sync time in local storage.
*

View File

@@ -4,6 +4,7 @@ import type { StateAddress } from "libsodium-wrappers";
const textDecoder = new TextDecoder();
const textEncoder = new TextEncoder();
export class DedicatedCryptoWorker {
async decryptMetadata(
encryptedMetadata: string,

View File

@@ -1,3 +1,11 @@
/**
* @file A thin-ish layer over the actual libsodium APIs, to make them more
* palatable to the rest of our Javascript code.
*
* All functions are stateless, async, and safe to use in Web Workers.
*
* Docs for the JS library: https://github.com/jedisct1/libsodium.js
*/
import { mergeUint8Arrays } from "@/utils/array";
import { CustomError } from "@ente/shared/error";
import sodium, { type StateAddress } from "libsodium-wrappers";