diff options
Diffstat (limited to 'third_party/nix/src/libutil/hash.hh')
-rw-r--r-- | third_party/nix/src/libutil/hash.hh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/third_party/nix/src/libutil/hash.hh b/third_party/nix/src/libutil/hash.hh index 4ad4ef6ada02..56845e715491 100644 --- a/third_party/nix/src/libutil/hash.hh +++ b/third_party/nix/src/libutil/hash.hh @@ -2,6 +2,7 @@ #include <absl/status/statusor.h> +#include "libproto/worker.grpc.pb.h" #include "libutil/serialise.hh" #include "libutil/types.hh" @@ -9,8 +10,12 @@ namespace nix { MakeError(BadHash, Error); +// TODO(grfn): Replace this with the hash type enum from the daemon proto so we +// don't have to juggle two different types enum HashType : char { htUnknown, htMD5, htSHA1, htSHA256, htSHA512 }; +std::optional<HashType> hash_type_from(nix::proto::HashType hash_type); + const int md5HashSize = 16; const int sha1HashSize = 20; const int sha256HashSize = 32; |