5 Commits

Author SHA1 Message Date
71ff3d4260 fix(base64): encode: incorrect padding if size % 3 == 2 2024-09-28 13:23:54 +03:00
bce26d3a4b submodule(update)
Some checks failed
Deploy documentation / deploy (push) Has been cancelled
2024-09-26 21:02:55 +03:00
44120b7ebb fix(docs.yml): on push main; update(Doxyfile): version 2024-09-26 20:55:30 +03:00
87a0cce29d update(AUTHORS) 2024-09-26 20:24:55 +03:00
9f939fea24 Merge pull request #2 from vSEK1RO/v1.0.2
V1.0.2
2024-09-26 20:23:15 +03:00
7 changed files with 11 additions and 13 deletions

View File

@ -1,8 +1,8 @@
name: Deploy documentation
on:
release:
types: [published]
push:
branches: ["main"]
permissions:
contents: read

View File

@ -1,5 +1,5 @@
libbasen project authors:
commits | username
62 | vSEK1RO
70 | vSEK1RO

View File

@ -48,7 +48,7 @@ PROJECT_NAME = libbasen
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = v1.0.1
PROJECT_NUMBER = v1.0.3
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@ -59,8 +59,6 @@ DIRS =\
${OBJDIR}\
${OBJDIR}/hash\
${LIBDIR}\
doc\
cov
build: library tools
@ -91,10 +89,10 @@ ${OBJDIR}/%${-g}-cov.o: ${SRCDIR}/%.cpp ${INCDIR}/${LIB}/%.hpp
${CC} -o $@ -c $< -I${INCDIR} ${-l} ${CFLAGS} --coverage
${BINDIR}/%${-g}-cov: ${TESTDIR}/%.cpp ${patsubst %, ${OBJDIR}/%${-g}-cov.o, ${OBJS}}
${CC} -o $@ $^ -I${INCDIR} ${-l} -lgtest ${CFLAGS} --coverage
${CC} -o $@ $^ -I${INCDIR} ${-l} -lgtest -lgcov ${CFLAGS}
clean:
rm -rf ${DIRS}
rm -rf ${DIRS} doc cov
ifneq (${OBJS},)

View File

@ -85,7 +85,7 @@ namespace base64
case 2:
str[last_idx] = digits[data[data_size - 2] >> 2];
str[last_idx + 1] = digits[(data[data_size - 2] << 4 | data[data_size - 1] >> 4) & 0x3F];
str[last_idx + 2] = digits[data[data_size - 1] & 0x0F];
str[last_idx + 2] = digits[data[data_size - 1] << 2 & 0x3F];
str[last_idx + 3] = '=';
break;
default:

View File

@ -21,8 +21,8 @@ TEST(base64, isValid)
std::vector<std::pair<std::string, std::string>> tests = {
{"", ""},
{"BKUEpQ==", "04a504a5"},
{"BKUEpQA=", "04a504a500"},
{"BKUEpQAA", "04a504a50000"},
{"aGVsbG8=", "68656c6c6f"},
{"aGVsbG9v", "68656c6c6f6f"},
};
TEST(base64, encode)
{
@ -49,7 +49,7 @@ TEST(base64, decode)
EXPECT_THROW(decode("FFF", 3, data.data(), data.size()), std::logic_error);
EXPECT_THROW(decode("!@#!", 4, data.data(), data.size()), std::logic_error);
EXPECT_THROW(decode("FF==", 2, data.data(), 0), std::length_error);
EXPECT_NO_THROW(decode("" , 0, data.data(), 0));
EXPECT_NO_THROW(decode("", 0, data.data(), 0));
}
TEST(base64, decode_1e7)
{