NSData+SSToolkitAdditions.h
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
// NSData+SSToolkitAdditions.h
// SSToolkit
//
// Created by Sam Soffes on 9/29/08.
// Copyright 2008-2011 Sam Soffes. All rights reserved.
//
/**
Provides extensions to `NSData` for various common tasks.
*/
@import UIKit;
@interface NSData (SSToolkitAdditions)
///--------------
/// @name Hashing
///--------------
/**
Returns a string of the MD5 sum of the receiver.
@return The string of the MD5 sum of the receiver.
*/
- (NSString *)MD5Sum;
/**
Returns a string of the SHA1 sum of the receiver.
@return The string of the SHA1 sum of the receiver.
*/
- (NSString *)SHA1Sum;
/**
Returns a string of the SHA256 sum of the receiver.
@return The string of the SHA256 sum of the receiver.
*/
- (NSString *)SHA256Sum;
///-----------------------------------
/// @name Base64 Encoding and Decoding
///-----------------------------------
/**
Returns a string representation of the receiver Base64 encoded.
@return A Base64 encoded string
*/
- (NSString *)base64EncodedString;
/**
Returns a new data contained in the Base64 encoded string.
@param base64String A Base64 encoded string
@return Data contained in `base64String`
*/
+ (NSData *)dataWithBase64String:(NSString *)base64String;
@end