Check if a variable value is base64 #66
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
need more info
need verification for fix
not so hard
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-tplgy/cppcodec#66
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is there a way to check with this code if some variable value was coded in base64? E.g. in an IF statement.
(I'm going to assume that the title was meant to refer to base64 like in your leading comment.)
There currently isn't a function that specifically returns a
trueorfalsevalue. I've been wanting to introduce one of these along with changes that make cppcodec error handling work without requiring exceptions. Haven't gotten to that part yet (sorry).So what you can do right now is call any variant of
base64_rfc4648::decode()with a throwawaybinary_resultargument and catchcppcodec::parse_error. If it throws a parse error, it's doesn't conform tobase64_rfc4648.Does that work for you until I get around to implementing a more proper validity-checking function?
Also relevant: issue #4 (yeah, I haven't made progress on this for a while now)