Is it expected behavior that two encodings can map to the same decoding? I'm trying to troubleshoot a digital signature issue by doing sanity checks on base64-encoded intermediate strings.
For example, the following base64 encoding:
R0VUDQoNCg0KRnJpLCAwNCBTZXAgMjAwOSAxMTowNTo0OSBHTVQrMDA6MDANCi8=
and:
R0VUCgoKRnJpLCAwNCBTZXAgMjAwOSAxMDozMzoyOCBHTVQrMDA6MDAKLw==
both decode to:
GET
Fri, 04 Sep 2009 11:05:49 GMT+00:00
/
(With the characters escaped, this is: GET\n\n\n Fri, 04 Sep 2009 11:05:49 GMT+00:00\n/
)
The first encoding comes from testing two online base64 encoders.
The second encoding comes from an Objective-C base64 encoder available here.
Is there something wrong with the result I'm generating with the Obj-C encoder?