SHA256 from file descriptor

Dridi Boukelmoune dridi at varni.sh
Wed May 22 09:36:54 UTC 2024


> Yes, but what do we need that for ?

We don't, I'm working in a VMOD that computes hashes of regular files
among other things. This looked like generic code not specific to that
VMOD.

> > Would the attached patch be welcome?
>
> If we have a need, that's pretty much how I would do it.

If you agree to expose this to VMODs, I can push this patch as is,
modulus paint color. I'm not sure I would keep the name "VSHA256_Fd"
if the fie descriptors are limited to regular (or mmap-able) files,
maybe "VSHA256_File" or "VSHA256_Map" is a better fit. If we want to
go all the way, I can also expose it to VUTs in libvarnishapi.

Dridi


More information about the varnish-dev mailing list