MCPcopy Create free account
hub / github.com/cuberite/cuberite / UnBase64

Function UnBase64

src/StringUtils.cpp:714–741  ·  view source on GitHub ↗

Converts one Hex character in a Base64 encoding into the data value

Source from the content-addressed store, hash-verified

712
713/// Converts one Hex character in a Base64 encoding into the data value
714static inline int UnBase64(char c)
715{
716 if (c >='A' && c <= 'Z')
717 {
718 return c - 'A';
719 }
720 if (c >='a' && c <= 'z')
721 {
722 return c - 'a' + 26;
723 }
724 if (c >= '0' && c <= '9')
725 {
726 return c - '0' + 52;
727 }
728 if (c == '+')
729 {
730 return 62;
731 }
732 if (c == '/')
733 {
734 return 63;
735 }
736 if (c == '=')
737 {
738 return -1;
739 }
740 return -2;
741}
742
743
744

Callers 1

Base64DecodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected