This repository has been archived by the owner on Nov 20, 2022. It is now read-only.
-
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.
- Loading branch information
1 parent
dce8b49
commit be94819
Showing
15 changed files
with
184 additions
and
132 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
Example/Pods/Target Support Files/lz-string-objc/lz-string-objc-Info.plist
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
Example/Pods/Target Support Files/lz-string-objc/lz-string-objc-umbrella.h
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// lz-string-objcTests.m | ||
// lz-string-objcTests | ||
// | ||
// Created by [email protected] on 11/04/2022. | ||
// Created by CoderWGB on 11/04/2022. | ||
// Copyright (c) 2022 [email protected]. All rights reserved. | ||
// | ||
|
||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// WGBAppDelegate.h | ||
// lz-string-objc | ||
// | ||
// Created by [email protected] on 11/04/2022. | ||
// Created by CoderWGB on 11/04/2022. | ||
// Copyright (c) 2022 [email protected]. All rights reserved. | ||
// | ||
|
||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// WGBAppDelegate.m | ||
// lz-string-objc | ||
// | ||
// Created by [email protected] on 11/04/2022. | ||
// Created by CoderWGB on 11/04/2022. | ||
// Copyright (c) 2022 [email protected]. All rights reserved. | ||
// | ||
|
||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// WGBViewController.h | ||
// lz-string-objc | ||
// | ||
// Created by [email protected] on 11/04/2022. | ||
// Created by CoderWGB on 11/04/2022. | ||
// Copyright (c) 2022 [email protected]. All rights reserved. | ||
// | ||
|
||
|
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 |
---|---|---|
|
@@ -2,11 +2,12 @@ | |
// WGBViewController.m | ||
// lz-string-objc | ||
// | ||
// Created by [email protected] on 11/04/2022. | ||
// Created by CoderWGB on 11/04/2022. | ||
// Copyright (c) 2022 [email protected]. All rights reserved. | ||
// | ||
|
||
#import "WGBViewController.h" | ||
#import <LZStringObjc.h> | ||
|
||
@interface WGBViewController () | ||
|
||
|
@@ -18,6 +19,26 @@ - (void)viewDidLoad | |
{ | ||
[super viewDidLoad]; | ||
// Do any additional setup after loading the view, typically from a nib. | ||
|
||
LZStringObjc *LZ = [LZStringObjc sharedInstance]; | ||
//base64 | ||
NSLog(@"%@",[LZ compressToBase64:@"hello"]); | ||
NSLog(@"%@",[LZ decompressFromBase64:@"BYUwNmD2Q==="]); | ||
|
||
//utf16 | ||
NSLog(@"%@",[LZ compressToUTF16:@"hello"]); | ||
NSLog(@"%@",[LZ decompressFromUTF16:@"ˢ䰭䰾搠"]); | ||
|
||
//unit8 | ||
NSLog(@"%@",[LZ compressToUint8Array:@"hello"]); | ||
NSString *str = @"55,129,176,166,7,96,230,2,224,22,0,32,47,2,10,192,26,4,8,192,158,51,0,206,200,32,3,0,30,1,176,1,193,106,20,12,96,197,1,152,11,228,0,0"; | ||
NSArray *strArr = [str componentsSeparatedByString:@","]; | ||
NSLog(@"%@",[LZ decompressFromUint8Array:strArr]); | ||
|
||
//uri | ||
NSLog(@"%@",[LZ compressToEncodedURIComponent:@"hello"]); | ||
NSLog(@"%@",[LZ decompressFromEncodedURIComponent:@"BYUwNmD2Q"]); | ||
|
||
} | ||
|
||
- (void)didReceiveMemoryWarning | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// main.m | ||
// lz-string-objc | ||
// | ||
// Created by [email protected] on 11/04/2022. | ||
// Created by CoderWGB on 11/04/2022. | ||
// Copyright (c) 2022 [email protected]. All rights reserved. | ||
// | ||
|
||
|
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 |
---|---|---|
|
@@ -5,10 +5,38 @@ | |
[![License](https://img.shields.io/cocoapods/l/lz-string-objc.svg?style=flat)](https://cocoapods.org/pods/lz-string-objc) | ||
[![Platform](https://img.shields.io/cocoapods/p/lz-string-objc.svg?style=flat)](https://cocoapods.org/pods/lz-string-objc) | ||
|
||
## Introduce | ||
|
||
站在巨人的肩膀上造轮子 | ||
https://github.com/pieroxy/lz-string 一个js压缩库 | ||
本轮子只是为了`OC`方便调用的问题,通过`js`去调用`lz-string.js`的接口 | ||
|
||
## Example | ||
|
||
To run the example project, clone the repo, and run `pod install` from the Example directory first. | ||
```objc | ||
#import <LZStringObjc.h> | ||
|
||
LZStringObjc *LZ = [LZStringObjc sharedInstance]; | ||
//base64 | ||
NSLog(@"%@",[LZ compressToBase64:@"hello"]); | ||
NSLog(@"%@",[LZ decompressFromBase64:@"BYUwNmD2Q==="]); | ||
|
||
//utf16 | ||
NSLog(@"%@",[LZ compressToUTF16:@"hello"]); | ||
NSLog(@"%@",[LZ decompressFromUTF16:@"ˢ䰭䰾搠"]); | ||
|
||
//unit8 | ||
NSLog(@"%@",[LZ compressToUint8Array:@"hello"]); | ||
NSString *str = @"55,129,176,166,7,96,230,2,224,22,0,32,47,2,10,192,26,4,8,192,158,51,0,206,200,32,3,0,30,1,176,1,193,106,20,12,96,197,1,152,11,228,0,0"; | ||
NSArray *strArr = [str componentsSeparatedByString:@","]; | ||
NSLog(@"%@",[LZ decompressFromUint8Array:strArr]); | ||
|
||
//uri | ||
NSLog(@"%@",[LZ compressToEncodedURIComponent:@"hello"]); | ||
NSLog(@"%@",[LZ decompressFromEncodedURIComponent:@"BYUwNmD2Q"]); | ||
|
||
``` | ||
## Requirements | ||
## Installation | ||
|
@@ -22,7 +50,7 @@ pod 'lz-string-objc' | |
|
||
## Author | ||
|
||
[email protected], [email protected] | ||
CoderWGB, [email protected] | ||
|
||
## License | ||
|
||
|
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
File renamed without changes.