3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-24 21:27:00 +00:00

hashlib: allow forcing Hasher state, use it for IdString trivial hashing

This commit is contained in:
Emil J. Tywoniak 2024-10-30 10:49:17 +01:00
parent c1af19fabc
commit 4d14399749
2 changed files with 13 additions and 0 deletions

View file

@ -132,6 +132,13 @@ class Hasher {
state ^= t;
}
void force(hash_t new_state) {
state = new_state;
}
bool is_new() const {
return state == Hasher().state;
}
};
template<typename T>