Olive.Hash/tests/Base64Test.pp

22 lines
2.4 KiB
ObjectPascal

Program Base64Test;
{$mode objfpc}{$H+}
{$codepage utf8}
uses
Classes, SysUtils, Hash.Base64, Math;
var
TestString, Teststring2 : UTF8String;
begin
TestString := 'Humans are creative beings. People tend to read writing. This text will not appear in a consistent order. After Hours Programming created this application. Default text is for web developers and designers that need default text quickly. Thank you for using this application. Your design looks awesome by the way. JavaScript has the awesome power to manipulate DOM elements on the fly. This string is randomly generated. I hope you enjoyed the fake text.';
TestString2 := 'Humans are creative beings. People tend to read writing. This text will not appear in a consistent order. After Hours Programming created this application. Default text is for web developers and designers that need default text quickly. Thank you for using this application. Your design looks awesome by the way. JavaScript has the awesome power to manipulate DOM elements on the fly. This string is randomly generated. I hope you enjoyed the fake text.';
writeln(RTBase64.Encode(TestString));
writeln(RTBase64.Decode('SHVtYW5zIGFyZSBjcmVhdGl2ZSBiZWluZ3MuIFBlb3BsZSB0ZW5kIHRvIHJlYWQgd3JpdGluZy4gVGhpcyB0ZXh0IHdpbGwgbm90IGFwcGVhciBpbiBhIGNvbnNpc3RlbnQgb3JkZXIuIEFmdGVyIEhvdXJzIFByb2dyYW1taW5nIGNyZWF0ZWQgdGhpcyBhcHBsaWNhdGlvbi4gRGVmYXVsdCB0ZXh0IGlzIGZvciB3ZWIgZGV2ZWxvcGVycyBhbmQgZGVzaWduZXJzIHRoYXQgbmVlZCBkZWZhdWx0IHRleHQgcXVpY2tseS4gVGhhbmsgeW91IGZvciB1c2luZyB0aGlzIGFwcGxpY2F0aW9uLiBZb3VyIGRlc2lnbiBsb29rcyBhd2Vzb21lIGJ5IHRoZSB3YXkuIEphdmFTY3JpcHQgaGFzIHRoZSBhd2Vzb21lIHBvd2VyIHRvIG1hbmlwdWxhdGUgRE9NIGVsZW1lbnRzIG9uIHRoZSBmbHkuIFRoaXMgc3RyaW5nIGlzIHJhbmRvbWx5ICBnZW5lcmF0ZWQuIEkgaG9wZSB5b3UgZW5qb3llZCB0aGUgZmFrZ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