diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-11-14 00:13:18 +0100 |
---|---|---|
committer | Ovahlord <dreadkiller@gmx.de> | 2024-11-14 00:30:53 +0100 |
commit | dcc59a3d9998f033dfabab81d334382ceb7e98b0 (patch) | |
tree | 46a2dc7ce0bc26013284bc34507c297410bc2a7e /src/common/Cryptography/BigNumber.cpp | |
parent | 36bece3fc53d1535abd38217908c3042c68dfa2a (diff) |
Core/Misc: Support IPv6 ip2location
(cherry picked from commit c522e5f4c22b53b349b05486fa28cdf58f4ffc26)
Diffstat (limited to 'src/common/Cryptography/BigNumber.cpp')
-rw-r--r-- | src/common/Cryptography/BigNumber.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/Cryptography/BigNumber.cpp b/src/common/Cryptography/BigNumber.cpp index f220ca319be..66071006a7f 100644 --- a/src/common/Cryptography/BigNumber.cpp +++ b/src/common/Cryptography/BigNumber.cpp @@ -61,6 +61,12 @@ void BigNumber::SetBinary(uint8 const* bytes, int32 len, bool littleEndian) BN_bin2bn(bytes, len, _bn); } +bool BigNumber::SetDecStr(char const* str) +{ + int n = BN_dec2bn(&_bn, str); + return n > 0; +} + bool BigNumber::SetHexStr(char const* str) { int n = BN_hex2bn(&_bn, str); |