feat(Doxyfile, doxygen-awesome)
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -42,6 +42,7 @@ BUILD.bazel
|
|||||||
bin
|
bin
|
||||||
obj
|
obj
|
||||||
lib
|
lib
|
||||||
|
doc
|
||||||
|
|
||||||
# IDE
|
# IDE
|
||||||
.vscode
|
.vscode
|
||||||
|
|||||||
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +1,6 @@
|
|||||||
[submodule "distrib/arch"]
|
[submodule "distrib/arch"]
|
||||||
path = distrib/arch
|
path = distrib/arch
|
||||||
url = https://aur.archlinux.org/libbasen.git
|
url = https://aur.archlinux.org/libbasen.git
|
||||||
|
[submodule "doxygen-awesome-css"]
|
||||||
|
path = doxygen-awesome-css
|
||||||
|
url = https://github.com/jothepro/doxygen-awesome-css.git
|
||||||
|
|||||||
5
Makefile
5
Makefile
@ -5,7 +5,7 @@ DEBUG ?= false
|
|||||||
USRDIR ?= /usr
|
USRDIR ?= /usr
|
||||||
|
|
||||||
.PHONY: build i install uni uninstall\
|
.PHONY: build i install uni uninstall\
|
||||||
tools library tests clean
|
tools library tests docs clean
|
||||||
|
|
||||||
LIB = basen
|
LIB = basen
|
||||||
OBJS =\
|
OBJS =\
|
||||||
@ -77,6 +77,9 @@ uninstall:
|
|||||||
rm -f ${patsubst %, ${USRLIB}/lib${LIB}${-g}%, .so .a}
|
rm -f ${patsubst %, ${USRLIB}/lib${LIB}${-g}%, .so .a}
|
||||||
rm -f ${patsubst %, ${USRBIN}/%${-g}, ${TOOLS}}
|
rm -f ${patsubst %, ${USRBIN}/%${-g}, ${TOOLS}}
|
||||||
|
|
||||||
|
docs:
|
||||||
|
doxygen Doxyfile
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf ${OBJDIR}/* ${LIBDIR}/* ${BINDIR}/*
|
rm -rf ${OBJDIR}/* ${LIBDIR}/* ${BINDIR}/*
|
||||||
|
|
||||||
|
|||||||
20
README.md
20
README.md
@ -1,15 +1,13 @@
|
|||||||
<p align="center"> <img style="height: 40px" src="https://i.imgur.com/ZOisFIu.png" /> </p>
|
# libbasen
|
||||||
|
|
||||||
<p align="center"> c++ encoding/decoding from arbitrary base </p>
|
c++ encoding/decoding from arbitrary base
|
||||||
|
|
||||||
<p align="center">
|
<a href="https://repology.org/project/libbasen/versions">
|
||||||
<a href="https://repology.org/project/libbasen/versions">
|
<img src="https://repology.org/badge/tiny-repos/libbasen.svg" alt="Packaging status">
|
||||||
<img src="https://repology.org/badge/tiny-repos/libbasen.svg" alt="Packaging status">
|
</a>
|
||||||
</a>
|
<a href="https://repology.org/project/libbasen/versions">
|
||||||
<a href="https://repology.org/project/libbasen/versions">
|
<img src="https://repology.org/badge/latest-versions/libbasen.svg" alt="latest packaged version(s)">
|
||||||
<img src="https://repology.org/badge/latest-versions/libbasen.svg" alt="latest packaged version(s)">
|
</a>
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -60,4 +58,4 @@ Now we would like to implement the following features:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
[:arrow_up:Contents](#contents)
|
[⬆️ Contents](#contents)
|
||||||
|
|||||||
1
doxygen-awesome-css
Submodule
1
doxygen-awesome-css
Submodule
Submodule doxygen-awesome-css added at 40e9b25b61
88
header.html
Normal file
88
header.html
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
<!-- HTML header for doxygen 1.12.0-->
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" lang="$langISO">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||||
|
<meta name="generator" content="Doxygen $doxygenversion"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||||
|
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
||||||
|
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
|
||||||
|
<!--BEGIN PROJECT_ICON-->
|
||||||
|
<link rel="icon" href="$relpath^$projecticon" type="image/x-icon" />
|
||||||
|
<!--END PROJECT_ICON-->
|
||||||
|
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
|
<!--BEGIN DISABLE_INDEX-->
|
||||||
|
<!--BEGIN FULL_SIDEBAR-->
|
||||||
|
<script type="text/javascript">var page_layout=1;</script>
|
||||||
|
<!--END FULL_SIDEBAR-->
|
||||||
|
<!--END DISABLE_INDEX-->
|
||||||
|
<script type="text/javascript" src="$relpath^jquery.js"></script>
|
||||||
|
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
||||||
|
<!--BEGIN COPY_CLIPBOARD-->
|
||||||
|
<script type="text/javascript" src="$relpath^clipboard.js"></script>
|
||||||
|
<!--END COPY_CLIPBOARD-->
|
||||||
|
$treeview
|
||||||
|
$search
|
||||||
|
$mathjax
|
||||||
|
$darkmode
|
||||||
|
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
||||||
|
$extrastylesheet
|
||||||
|
<script type="text/javascript" src="$relpath^doxygen-awesome-darkmode-toggle.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
DoxygenAwesomeDarkModeToggle.init()
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="$relpath^doxygen-awesome-fragment-copy-button.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
DoxygenAwesomeFragmentCopyButton.init()
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!--BEGIN DISABLE_INDEX-->
|
||||||
|
<!--BEGIN FULL_SIDEBAR-->
|
||||||
|
<div id="side-nav" class="ui-resizable side-nav-resizable"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
<!--END FULL_SIDEBAR-->
|
||||||
|
<!--END DISABLE_INDEX-->
|
||||||
|
|
||||||
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
|
|
||||||
|
<!--BEGIN TITLEAREA-->
|
||||||
|
<div id="titlearea">
|
||||||
|
<table cellspacing="0" cellpadding="0">
|
||||||
|
<tbody>
|
||||||
|
<tr id="projectrow">
|
||||||
|
<!--BEGIN PROJECT_LOGO-->
|
||||||
|
<td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"$logosize/></td>
|
||||||
|
<!--END PROJECT_LOGO-->
|
||||||
|
<!--BEGIN PROJECT_NAME-->
|
||||||
|
<td id="projectalign">
|
||||||
|
<div id="projectname">$projectname<!--BEGIN PROJECT_NUMBER--><span id="projectnumber"> $projectnumber</span><!--END PROJECT_NUMBER-->
|
||||||
|
</div>
|
||||||
|
<!--BEGIN PROJECT_BRIEF--><div id="projectbrief">$projectbrief</div><!--END PROJECT_BRIEF-->
|
||||||
|
</td>
|
||||||
|
<!--END PROJECT_NAME-->
|
||||||
|
<!--BEGIN !PROJECT_NAME-->
|
||||||
|
<!--BEGIN PROJECT_BRIEF-->
|
||||||
|
<td>
|
||||||
|
<div id="projectbrief">$projectbrief</div>
|
||||||
|
</td>
|
||||||
|
<!--END PROJECT_BRIEF-->
|
||||||
|
<!--END !PROJECT_NAME-->
|
||||||
|
<!--BEGIN DISABLE_INDEX-->
|
||||||
|
<!--BEGIN SEARCHENGINE-->
|
||||||
|
<!--BEGIN !FULL_SIDEBAR-->
|
||||||
|
<td>$searchbox</td>
|
||||||
|
<!--END !FULL_SIDEBAR-->
|
||||||
|
<!--END SEARCHENGINE-->
|
||||||
|
<!--END DISABLE_INDEX-->
|
||||||
|
</tr>
|
||||||
|
<!--BEGIN SEARCHENGINE-->
|
||||||
|
<!--BEGIN FULL_SIDEBAR-->
|
||||||
|
<tr><td colspan="2">$searchbox</td></tr>
|
||||||
|
<!--END FULL_SIDEBAR-->
|
||||||
|
<!--END SEARCHENGINE-->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!--END TITLEAREA-->
|
||||||
|
<!-- end header part -->
|
||||||
@ -13,6 +13,24 @@ namespace baseN
|
|||||||
uint64_t sizeEncoded(std::span<const uint8_t> data, uint8_t base);
|
uint64_t sizeEncoded(std::span<const uint8_t> data, uint8_t base);
|
||||||
uint64_t sizeDecoded(std::string_view str, uint8_t base, const char* digits) noexcept;
|
uint64_t sizeDecoded(std::string_view str, uint8_t base, const char* digits) noexcept;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param data pointer to data which you want encode
|
||||||
|
* @param data_size count of bytes to encode
|
||||||
|
* @param str pointer to string for encoded data output
|
||||||
|
* @param str_size str allocated size
|
||||||
|
* @param base since 1, up to 256
|
||||||
|
* @param digits char[base] array of digits
|
||||||
|
* @code{cpp}
|
||||||
|
* std::vector<uint8_t> data;
|
||||||
|
* std::string str(baseN::sizeEncoded(data, 58));
|
||||||
|
*
|
||||||
|
* auto offset = baseN::encode(data.data(), data.size(), str.data(), str.size(), 58, base58::digits);
|
||||||
|
* // deleting leading zeroes
|
||||||
|
* str.erase(str.begin(), str.begin() + offset);
|
||||||
|
* @endcode
|
||||||
|
* @return returns number of leading chars, which should be trimmed
|
||||||
|
* @warning contain leading zeros, returns count of them
|
||||||
|
*/
|
||||||
uint64_t encode(const uint8_t *data, uint64_t data_size, char *str, uint64_t str_size, uint8_t base, const char *digits);
|
uint64_t encode(const uint8_t *data, uint64_t data_size, char *str, uint64_t str_size, uint8_t base, const char *digits);
|
||||||
std::string encode(std::span<const uint8_t> data, uint8_t base, const char *digits) noexcept;
|
std::string encode(std::span<const uint8_t> data, uint8_t base, const char *digits) noexcept;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user