aboutsummaryrefslogtreecommitdiff
path: root/src/common/Cryptography/BigNumber.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-11-14 00:13:18 +0100
committerShauren <shauren.trinity@gmail.com>2024-11-14 00:13:18 +0100
commitc522e5f4c22b53b349b05486fa28cdf58f4ffc26 (patch)
treeb7be7dd7c24718eb82ceee6a09b36c80da8c9c27 /src/common/Cryptography/BigNumber.cpp
parente8d949c7943cbc49bc7e5411b9ed169b422b8472 (diff)
Core/Misc: Support IPv6 ip2location
Diffstat (limited to 'src/common/Cryptography/BigNumber.cpp')
-rw-r--r--src/common/Cryptography/BigNumber.cpp6
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);