forked from daltoniam/Starscream
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom wrapper for SHA1 and custom modulemap for framework includ…
…ing module maps for CommonCrypto and zlib
- Loading branch information
Showing
11 changed files
with
125 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
////////////////////////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// NSString+SHA1.h | ||
// Starscream | ||
// | ||
// Created by Sergey Lem on 6/25/18. | ||
// Copyright (c) 2014-2016 Dalton Cherry. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface NSString (SHA1) | ||
|
||
- (NSString *)ss_SHA1Base64Digest; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
////////////////////////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// NSString+SHA1.m | ||
// Starscream | ||
// | ||
// Created by Sergey Lem on 6/25/18. | ||
// Copyright (c) 2014-2016 Dalton Cherry. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
////////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#import "NSString+SHA1.h" | ||
#import <CommonCrypto/CommonDigest.h> | ||
|
||
@implementation NSString (SHA1) | ||
|
||
- (NSString *)ss_SHA1Base64Digest { | ||
NSData *stringData = [self dataUsingEncoding:NSUTF8StringEncoding]; | ||
NSMutableData *digest = [NSMutableData dataWithLength:CC_SHA1_DIGEST_LENGTH]; | ||
CC_SHA1(stringData.bytes, stringData.length, digest.mutableBytes); | ||
return [digest base64EncodedDataWithOptions:0]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
framework module Starscream { | ||
umbrella header "Starscream.h" | ||
|
||
export * | ||
|
||
explicit module SSCZLib [system] { | ||
header "include.h" | ||
link "z" | ||
export * | ||
} | ||
explicit module SSCommonCrypto [system] { | ||
private header "NSString+SHA1.h" | ||
link "CommonCrypto" | ||
export * | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include <zlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.