MCPcopy Create free account
hub / github.com/buggins/coolreader / parseBase64

Function parseBase64

tinydict/tinydict.cpp:287–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285static const char * base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
286
287static unsigned parseBase64( const char * str )
288{
289 int i;
290 if ( !*base64table ) {
291 for ( i=0; i<128; i++ )
292 base64table[i] = -1;
293 for ( i=0; base64chars[i]; i++ )
294 base64table[(unsigned)base64chars[i]] = i;
295 }
296 unsigned n = 0;
297 for ( ; *str; str++ ) {
298 int code = base64table[ (unsigned)*str ];
299 if ( code<0 )
300 return (unsigned)-1;
301 n = ( n << 6 ) + code;
302 }
303 return n;
304}
305
306int TinyDictWord::compare( const char * str ) const
307{

Callers 1

readMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected