From 73695c4fde78a2fde0ca8badc05890d4c11a0ce5 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 10 May 2021 16:10:14 +0100 Subject: Refactor the Base64 encoding and decoding functions. --- src/modules/m_pbkdf2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/modules/m_pbkdf2.cpp') diff --git a/src/modules/m_pbkdf2.cpp b/src/modules/m_pbkdf2.cpp index 7bad7c3fa..c44f4b384 100644 --- a/src/modules/m_pbkdf2.cpp +++ b/src/modules/m_pbkdf2.cpp @@ -49,10 +49,10 @@ class PBKDF2Hash this->iterations = ConvToNum(tok); ss.GetToken(tok); - this->hash = Base64ToBin(tok); + this->hash = Base64::Decode(tok); ss.GetToken(tok); - this->salt = Base64ToBin(tok); + this->salt = Base64::Decode(tok); this->length = this->hash.length(); } @@ -61,7 +61,7 @@ class PBKDF2Hash { if (!IsValid()) return ""; - return ConvToStr(this->iterations) + ":" + BinToBase64(this->hash) + ":" + BinToBase64(this->salt); + return ConvToStr(this->iterations) + ":" + Base64::Encode(this->hash) + ":" + Base64::Encode(this->salt); } bool IsValid() -- cgit v1.3.1-10-gc9f91