Quick.Base64.pas 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. { ***************************************************************************
  2. Copyright (c) 2016-2017 Kike Pérez
  3. Unit : Quick.Base64
  4. Description : Log Api Redis Provider
  5. Author : Kike Pérez
  6. Version : 1.1
  7. Created : 08/11/2017
  8. Modified : 07/05/2018
  9. This file is part of QuickLib: https://github.com/exilon/QuickLib
  10. ***************************************************************************
  11. Licensed under the Apache License, Version 2.0 (the "License");
  12. you may not use this file except in compliance with the License.
  13. You may obtain a copy of the License at
  14. http://www.apache.org/licenses/LICENSE-2.0
  15. Unless required by applicable law or agreed to in writing, software
  16. distributed under the License is distributed on an "AS IS" BASIS,
  17. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18. See the License for the specific language governing permissions and
  19. limitations under the License.
  20. *************************************************************************** }
  21. unit Quick.Base64;
  22. interface
  23. {$i QuickLib.inc}
  24. uses
  25. IdCoderMIME,
  26. IdGlobal;
  27. function Base64Encode(const Input: string): string;
  28. function Base64Decode(const Input: string): string;
  29. implementation
  30. function Base64Encode(const Input: string): string;
  31. begin
  32. Result := TIdEncoderMIME.EncodeString(Input,IndyTextEncoding_OSDefault);
  33. end;
  34. function Base64Decode(const Input: string): string;
  35. begin
  36. Result := TIdDecoderMIME.DecodeString(Input,IndyTextEncoding_OSDefault);
  37. end;
  38. end.