mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 14:28:17 +03:00
9cf177a939
Summary: This removes one manual from EdenFS build Reviewed By: luciang Differential Revision: D45107863 fbshipit-source-id: fc850ab91d8390671b698186feb9a199a86d6594
38 lines
801 B
C++
38 lines
801 B
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <folly/Range.h>
|
|
|
|
#include <blake3.h>
|
|
|
|
namespace facebook::eden {
|
|
|
|
struct Blake3 final {
|
|
Blake3();
|
|
|
|
/*
|
|
* Initialize a blake3_hasher in the keyed hashing mode. The key must be
|
|
* exactly 32 bytes.
|
|
* It mostly used for security purposes to make it harder creating a rainbow
|
|
* table in the future
|
|
*/
|
|
explicit Blake3(folly::ByteRange key);
|
|
|
|
void update(const void* data, size_t size);
|
|
void update(folly::ByteRange data);
|
|
void update(folly::StringPiece data);
|
|
|
|
void finalize(folly::MutableByteRange out);
|
|
|
|
private:
|
|
blake3_hasher hasher_;
|
|
};
|
|
|
|
} // namespace facebook::eden
|