Doing so I found that Base64 allows '+' and '/' as characters which is
bad for directory names obviously.
For now these characters get replaced with 'A' and 'B'.
'_' and '@' would be better replacements (with comments why they are
used) since 'A' and 'B' are already characters in Base64.
Some quick research (aka googling) revealed
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_278
It seems '_' and '-' are safer choices.
+ // unexpected hexchar
This raise an internal error, not just be a comment.
Is there an error exit function in CMake?
Or just exit(-1);
+ }
+ }
+ hashBytes[ii] = hbyte[0] | (hbyte[1] << 4);
+ }
+ }
+ // Convert hash bytes to Base64 text string
+ {
+ std::vector<unsigned char> base64Bytes(hashBytes.size() * 2, 0);
+ cmsysBase64_Encode(&hashBytes[0], hashBytes.size(), &base64Bytes[0], 0);
+ checksumBase64 = reinterpret_cast<const char*>(&base64Bytes[0]);
+ // Base64 allows '+' and '/' characters. Replace these.
This comment should indicate it is because the string is used as part of
a path and that these characters tend to cause problems in paths.
Ok.
-Sebastian
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers