3 Commits

Author SHA1 Message Date
ff888a88f4 fix(base64): encode: incorrect padding if size % 3 == 2 2024-09-28 13:21:42 +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
6 changed files with 10 additions and 12 deletions

View File

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

View File

@ -48,7 +48,7 @@ PROJECT_NAME = libbasen
# could be handy for archiving the generated documentation or if some version # could be handy for archiving the generated documentation or if some version
# control system is used. # 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 # 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 # 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}\
${OBJDIR}/hash\ ${OBJDIR}/hash\
${LIBDIR}\ ${LIBDIR}\
doc\
cov
build: library tools build: library tools
@ -91,10 +89,10 @@ ${OBJDIR}/%${-g}-cov.o: ${SRCDIR}/%.cpp ${INCDIR}/${LIB}/%.hpp
${CC} -o $@ -c $< -I${INCDIR} ${-l} ${CFLAGS} --coverage ${CC} -o $@ -c $< -I${INCDIR} ${-l} ${CFLAGS} --coverage
${BINDIR}/%${-g}-cov: ${TESTDIR}/%.cpp ${patsubst %, ${OBJDIR}/%${-g}-cov.o, ${OBJS}} ${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: clean:
rm -rf ${DIRS} rm -rf ${DIRS} doc cov
ifneq (${OBJS},) ifneq (${OBJS},)

View File

@ -85,7 +85,7 @@ namespace base64
case 2: case 2:
str[last_idx] = digits[data[data_size - 2] >> 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 + 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] = '='; str[last_idx + 3] = '=';
break; break;
default: default:

View File

@ -21,8 +21,8 @@ TEST(base64, isValid)
std::vector<std::pair<std::string, std::string>> tests = { std::vector<std::pair<std::string, std::string>> tests = {
{"", ""}, {"", ""},
{"BKUEpQ==", "04a504a5"}, {"BKUEpQ==", "04a504a5"},
{"BKUEpQA=", "04a504a500"}, {"aGVsbG8=", "68656c6c6f"},
{"BKUEpQAA", "04a504a50000"}, {"aGVsbG9v", "68656c6c6f6f"},
}; };
TEST(base64, encode) TEST(base64, encode)
{ {