Keine Beschreibung

NSData+Base64.h 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // NSData+Base64.h
  3. // base64
  4. //
  5. // Created by Matt Gallagher on 2009/06/03.
  6. // Copyright 2009 Matt Gallagher. All rights reserved.
  7. //
  8. // This software is provided 'as-is', without any express or implied
  9. // warranty. In no event will the authors be held liable for any damages
  10. // arising from the use of this software. Permission is granted to anyone to
  11. // use this software for any purpose, including commercial applications, and to
  12. // alter it and redistribute it freely, subject to the following restrictions:
  13. //
  14. // 1. The origin of this software must not be misrepresented; you must not
  15. // claim that you wrote the original software. If you use this software
  16. // in a product, an acknowledgment in the product documentation would be
  17. // appreciated but is not required.
  18. // 2. Altered source versions must be plainly marked as such, and must not be
  19. // misrepresented as being the original software.
  20. // 3. This notice may not be removed or altered from any source
  21. // distribution.
  22. //
  23. #import <Foundation/Foundation.h>
  24. void *NewBase64Decode(
  25. const char *inputBuffer,
  26. size_t length,
  27. size_t *outputLength);
  28. char *NewBase64Encode(
  29. const void *inputBuffer,
  30. size_t length,
  31. bool separateLines,
  32. size_t *outputLength);
  33. @interface NSData (Base64)
  34. + (NSData *)dataFromBase64String:(NSString *)aString;
  35. - (NSString *)base64EncodedString;
  36. @end