From 321aa8527de1333259b96b011eaf19aab4ab3143 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Fri, 16 Jun 2017 04:32:03 -0700 Subject: [PATCH] Fix base64 alphabet fix #500 --- CHANGELOG.md | 1 + include/beast/core/detail/base64.hpp | 2 +- test/core/base64.cpp | 13 +++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 405c3766..23e36652 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ Version 59: * Integrated Beast INTERFACE (cmake) +* Fix base64 alphabet API Changes: diff --git a/include/beast/core/detail/base64.hpp b/include/beast/core/detail/base64.hpp index 3ddcf863..31b426a6 100644 --- a/include/beast/core/detail/base64.hpp +++ b/include/beast/core/detail/base64.hpp @@ -66,7 +66,7 @@ get_inverse() -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 16-31 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, // 32-47 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, // 48-63 - -1, -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, // 64-79 + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, // 64-79 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, // 80-95 -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, // 96-111 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, // 112-127 diff --git a/test/core/base64.cpp b/test/core/base64.cpp index 606f8b13..e33f65d6 100644 --- a/test/core/base64.cpp +++ b/test/core/base64.cpp @@ -34,6 +34,19 @@ public: check ("foob", "Zm9vYg=="); check ("fooba", "Zm9vYmE="); check ("foobar", "Zm9vYmFy"); + + check( + "Man is distinguished, not only by his reason, but by this singular passion from " + "other animals, which is a lust of the mind, that by a perseverance of delight " + "in the continued and indefatigable generation of knowledge, exceeds the short " + "vehemence of any carnal pleasure." + , + "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz" + "IHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2Yg" + "dGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu" + "dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRo" + "ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=" + ); } };