MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / hasherUpdate

Function hasherUpdate

javascript/lib.c:381–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

379}
380
381napi_value hasherUpdate(napi_env env, napi_callback_info info) {
382 size_t argc = 1;
383 napi_value args[1];
384 napi_value js_this;
385 napi_get_cb_info(env, info, &argc, args, &js_this, NULL);
386
387 hasher_t *hasher;
388 napi_unwrap(env, js_this, (void **)&hasher);
389
390 void *buffer_data;
391 size_t buffer_length;
392 napi_status status = napi_get_buffer_info(env, args[0], &buffer_data, &buffer_length);
393 if (status != napi_ok) {
394 napi_throw_error(env, NULL, "Argument must be a Buffer");
395 return NULL;
396 }
397
398 sz_hash_state_update(&hasher->state, (sz_cptr_t)buffer_data, buffer_length);
399 return js_this;
400}
401
402napi_value hasherDigest(napi_env env, napi_callback_info info) {
403 napi_value js_this;

Callers

nothing calls this directly

Calls 1

sz_hash_state_updateFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…