mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:48:11 +00:00
LibCrypto: Add hash methods to {Signed, Unsigned}BigInteger
These just use hash the underlying bytes that make up the integer words
This commit is contained in:
parent
71c54198fa
commit
b17a282b4b
4 changed files with 25 additions and 0 deletions
|
@ -217,6 +217,11 @@ FLATTEN SignedDivisionResult SignedBigInteger::divided_by(const SignedBigInteger
|
|||
};
|
||||
}
|
||||
|
||||
u32 SignedBigInteger::hash() const
|
||||
{
|
||||
return m_unsigned_data.hash() * (1 - (2 * m_sign));
|
||||
}
|
||||
|
||||
void SignedBigInteger::set_bit_inplace(size_t bit_index)
|
||||
{
|
||||
m_unsigned_data.set_bit_inplace(bit_index);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue