
static JSValue js_sha1_push(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
{
	const u8 *data;
	size_t data_size;
	GF_SHA1Context *sha1 = JS_GetOpaque(this_val, sha1_class_id);
	if (!sha1) {
		sha1 = gf_sha1_starts();
		if (!sha1) {
			return js_throw_err(ctx, GF_OUT_OF_MEM);
		}
		JS_SetOpaque(this_val, sha1);
	}
	if (!argc) return GF_JS_EXCEPTION(ctx);
	data = JS_GetArrayBuffer(ctx, &data_size, argv[0]);
	gf_sha1_update(sha1, (u8 *) data, (u32) data_size);

	return JS_UNDEFINED;

static JSValue js_sha1_push(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv)
{
	const u8 *data;
	size_t data_size;
	GF_SHA1Context *sha1 = JS_GetOpaque(this_val, sha1_class_id);
	if (!sha1) {
		sha1 = gf_sha1_starts();
		if (!sha1) {
			return js_throw_err(ctx, GF_OUT_OF_MEM);
		}
		JS_SetOpaque(this_val, sha1);
	}
	if (!argc) return GF_JS_EXCEPTION(ctx);
	data = JS_GetArrayBuffer(ctx, &data_size, argv[0]);
	gf_sha1_update(sha1, (u8 *) data, (u32) data_size);

	return JS_UNDEFINED;