You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
_xeroxz
9d5d4f0338
|
3 years ago | |
---|---|---|
README.md | 3 years ago |
README.md
LLO - Low Level Obfuscation Utils
This repo contains a list of utils that will probably need to be implimented for LLO.
- llo::utils::generate_random, generate a random numerical value.
template <class T>
auto generate_random() -> T
{
std::random_device rd;
std::mt19937 mt(rd());
std::uniform_real_distribution<double> dist(1.0, 10.0);
return dist(mt);
}
- llo::utils::hash_t templated class that contains unique std::uint64_t hash value for any given data. use std::hash to compute the hash. https://en.cppreference.com/w/cpp/utility/hash. use std::hashstd::varient to hash type T and a random uint64_t..
template <class T>
class T hash_t
{
hash_t hash(const T& data, std::size_t hash_result)
: data {&data}, hash_result{hash_result}
{}
std::size_t hash_result;
const T* data;
public:
static std::shared_ptr<hash_t> make(const T& data)
{
auto hash = std::hash<std::varient<T, std::uint64_t>>{}(data, llo::utils::generate_random<std::uint64_t>());
return std::make_shared<hash_t>(data, hash);
}
T& get_data() const;
std::size_t get_hash() const;
};