projects
/
oweals
/
minetest.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow taking screenshots of formspecs and move message to chat
[oweals/minetest.git]
/
src
/
base64.cpp
diff --git
a/src/base64.cpp
b/src/base64.cpp
index 0dfba501303aa4606232c5f667f35f6ea895b86c..728814b003dce0b7081168d2708f8b0b705d40de 100644
(file)
--- a/
src/base64.cpp
+++ b/
src/base64.cpp
@@
-38,6
+38,13
@@
static inline bool is_base64(unsigned char c) {
return (isalnum(c) || (c == '+') || (c == '/'));
}
return (isalnum(c) || (c == '+') || (c == '/'));
}
+bool base64_is_valid(std::string const& s)
+{
+ for(size_t i=0; i<s.size(); i++)
+ if(!is_base64(s[i])) return false;
+ return true;
+}
+
std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) {
std::string ret;
int i = 0;
std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len) {
std::string ret;
int i = 0;