<commit_before>#if 0
set -e -x
g++ -Wall -Werror -DINCLUDE_BASE64_TEST_MAIN base64.cc -o base64_test
./base64_test
exit 0
;;
#endif

/*
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.<commit_msg>document all the base64 variants, support them someday?<commit_after>#if 0
set -e -x
g++ -Wall -Werror -DINCLUDE_BASE64_TEST_MAIN base64.cc -o base64_test
./base64_test
exit 0
;;
#endif

// all the base 64 variants!  note we support RFC 4648 section 4.
//
// RFC 1421 privacy enhanced mail (deprecated)
//   lines no longer than 64, padding with = mandatory
//   ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
//   non-decoding chars error
// RFC 2045 base64 for MIME
//   lines no longer than 76, padding with = mandatory
//   ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
//   non-decoding chars discarded
// RFC 2152 UTF-7
//   no line breaks, no padding
//   ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
// RFC 3501 IMAP mailbox names
//   no line breaks, no padding
//   ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+,
// RFC 3548 attempts to unify RFC 1421 and RFC 2045
//   obsoleted by RFC 4648
// RFC 4648 section 4 standard base64 (www etc)
//   no line breaks, padding with = optional
//   ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
// RFC 4648 section 5 base64url (url and filename-safe)
//   no line breaks, padding with = optional
//   ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_
// RFC 4880 radix-64 for OpenPGP
//   lines no longer than 76, padding with = mandatory
//   ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
//   ALSO requires radix-64 encoded 24-bit CRC
// uuencode / uudecode (6 bit value plus 0x20 --> ascii)
//   note below, first char is space (0x20)
//    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
// binhex4 (mac OS) excludes visually confusing chars
//   !"#$%&'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr
// unix crypt ("B64")
//   ./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
// GEDCOM 5.5 standard (geological data interchange)
//   <same as unix crypt>
// bcrypt (<NAME>, <NAME>res, based on blowfish)
//   ./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
// xxencoding
//   +-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
// 6PACK....... no.
// GNU BASH
//   0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@_
//

/*
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
{'fraction_non_alphanumeric': 0.0755059678256357, 'fraction_numerical': 0.06123508043591074, 'mean_word_length': 4.280821917808219, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6233305', 'n_tokens_mistral': 1516, 'n_tokens_neox': 1251, 'n_words': 455}