From c522e5f4c22b53b349b05486fa28cdf58f4ffc26 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 14 Nov 2024 00:13:18 +0100 Subject: Core/Misc: Support IPv6 ip2location --- src/common/Cryptography/BigNumber.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/common/Cryptography/BigNumber.cpp') 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); -- cgit v1.2.3