Skip to content

Commit

Permalink
Merge branch 'release/3.4.0' into versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeehut committed Sep 28, 2021
2 parents 50b84f0 + e11aed5 commit 5d6a6df
Show file tree
Hide file tree
Showing 46 changed files with 2,471 additions and 2,366 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ If needed, pluralize to `Tasks`, `PRs` or `Authors` and list multiple entries se

## [Unreleased]
### Added
- Added `round(fractionDigits:rule:)` & `rounded(fractionDigits:rule:)` methods to `Double` type.
Author: [Cihat Gündüz](https://github.com/Jeehut)
- None.
### Changed
- None.
### Deprecated
Expand All @@ -32,6 +31,11 @@ Author: [Cihat Gündüz](https://github.com/Jeehut)
### Security
- None.

## [3.4.0] - 2021-09-28
### Added
- Added new convenience `encrypt(key:)` and `decrypt(key:)` functions to `String` type for platforms supporting `CryptoKit`. Uses AES.GCM algorithm for encryption.
Author: [Cihat Gündüz](https://github.com/Jeehut)

## [3.3.0] - 2021-01-16
### Added
- Added `round(fractionDigits:rule:)` & `rounded(fractionDigits:rule:)` methods to `Double` type.
Expand Down
2 changes: 1 addition & 1 deletion HandySwift.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "HandySwift"
s.version = "3.3.0"
s.version = "3.4.0"
s.summary = "Handy Swift features that didn't make it into the Swift standard library"

s.description = <<-DESC
Expand Down
10 changes: 10 additions & 0 deletions HandySwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
2E61DF7E249E1D37000AF3C5 /* WithableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E61DF7D249E1D37000AF3C5 /* WithableTests.swift */; };
2E61DF7F249E1D37000AF3C5 /* WithableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E61DF7D249E1D37000AF3C5 /* WithableTests.swift */; };
2E61DF80249E1D37000AF3C5 /* WithableTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E61DF7D249E1D37000AF3C5 /* WithableTests.swift */; };
2E86A32025E5943800845C6D /* DataExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E86A31F25E5943800845C6D /* DataExt.swift */; };
2E86A32125E5943800845C6D /* DataExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E86A31F25E5943800845C6D /* DataExt.swift */; };
2E86A32225E5943800845C6D /* DataExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E86A31F25E5943800845C6D /* DataExt.swift */; };
3F95C8D220F22A3C0045AFD0 /* CollectionExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F95C8D120F22A3C0045AFD0 /* CollectionExt.swift */; };
3F95C8D520F22DEE0045AFD0 /* CollectionExtTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F95C8D320F22DC60045AFD0 /* CollectionExtTests.swift */; };
3F95C8D620F22DEF0045AFD0 /* CollectionExtTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F95C8D320F22DC60045AFD0 /* CollectionExtTests.swift */; };
Expand Down Expand Up @@ -156,6 +159,7 @@
2E5A375325655F55003704D0 /* StringProtocolExt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringProtocolExt.swift; sourceTree = "<group>"; };
2E61DF79249E1CA9000AF3C5 /* Withable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Withable.swift; sourceTree = "<group>"; };
2E61DF7D249E1D37000AF3C5 /* WithableTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WithableTests.swift; sourceTree = "<group>"; };
2E86A31F25E5943800845C6D /* DataExt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataExt.swift; sourceTree = "<group>"; };
3F95C8D120F22A3C0045AFD0 /* CollectionExt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionExt.swift; sourceTree = "<group>"; };
3F95C8D320F22DC60045AFD0 /* CollectionExtTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionExtTests.swift; sourceTree = "<group>"; };
63651F8F231BFF2000E022DA /* DivisibleArithmetic.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DivisibleArithmetic.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -284,7 +288,9 @@
A1F5AEEA1E05700F003D6949 /* RootFiles */,
823B2B321C24AAB6007B3CDD /* Products */,
);
indentWidth = 4;
sourceTree = "<group>";
tabWidth = 4;
};
823B2B321C24AAB6007B3CDD /* Products */ = {
isa = PBXGroup;
Expand All @@ -305,6 +311,7 @@
82CAE2951C2EE64900F934A7 /* ArrayExt.swift */,
3F95C8D120F22A3C0045AFD0 /* CollectionExt.swift */,
CC66E046228199A0007ABF61 /* ComparableExt.swift */,
2E86A31F25E5943800845C6D /* DataExt.swift */,
8280D7DB1C4A6EC9001172EF /* DictionaryExt.swift */,
A1F221631E3CC05100419B06 /* DispatchTimeIntervalExt.swift */,
2E18AD592531DD3D00D44748 /* DoubleExt.swift */,
Expand Down Expand Up @@ -783,6 +790,7 @@
CC120CC2205FDB9300C37D7C /* Regex.swift in Sources */,
826F69AC1C3895A300B2CC6B /* FrequencyTable.swift in Sources */,
2E18B292242DECCA000C7776 /* NSObjectExt.swift in Sources */,
2E86A32025E5943800845C6D /* DataExt.swift in Sources */,
A1F221641E3CC05100419B06 /* DispatchTimeIntervalExt.swift in Sources */,
8218E4D62211D193007AAAF3 /* NSRangeExt.swift in Sources */,
3F95C8D220F22A3C0045AFD0 /* CollectionExt.swift in Sources */,
Expand Down Expand Up @@ -833,6 +841,7 @@
CC120CC3205FDC4C00C37D7C /* Regex.swift in Sources */,
C5CFB6AD20B0A70300830511 /* Unowned.swift in Sources */,
2E18B293242DECCA000C7776 /* NSObjectExt.swift in Sources */,
2E86A32125E5943800845C6D /* DataExt.swift in Sources */,
826F69AD1C3895A300B2CC6B /* FrequencyTable.swift in Sources */,
8218E4D72211D193007AAAF3 /* NSRangeExt.swift in Sources */,
825EFE051C33358400558497 /* StringExt.swift in Sources */,
Expand Down Expand Up @@ -883,6 +892,7 @@
CC120CC4205FDC4D00C37D7C /* Regex.swift in Sources */,
C5CFB6AE20B0A70300830511 /* Unowned.swift in Sources */,
2E18B294242DECCA000C7776 /* NSObjectExt.swift in Sources */,
2E86A32225E5943800845C6D /* DataExt.swift in Sources */,
826F69AE1C3895A300B2CC6B /* FrequencyTable.swift in Sources */,
8218E4D82211D193007AAAF3 /* NSRangeExt.swift in Sources */,
825EFE0B1C33358500558497 /* StringExt.swift in Sources */,
Expand Down
23 changes: 8 additions & 15 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@
import PackageDescription

let package = Package(
name: "HandySwift",
products: [
.library(name: "HandySwift", targets: ["HandySwift"])
],
targets: [
.target(
name: "HandySwift",
exclude: ["Sources/SupportingFiles"]
),
.testTarget(
name: "HandySwiftTests",
dependencies: ["HandySwift"],
exclude: ["Tests/SupportingFiles"]
)
]
name: "HandySwift",
products: [
.library(name: "HandySwift", targets: ["HandySwift"])
],
targets: [
.target(name: "HandySwift"),
.testTarget(name: "HandySwiftTests", dependencies: ["HandySwift"])
]
)
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
alt="Coverage"/>
</a>
<a href="https://github.com/Flinesoft/HandySwift/releases">
<img src="https://img.shields.io/badge/Version-3.3.0-blue.svg"
alt="Version: 3.3.0">
<img src="https://img.shields.io/badge/Version-3.4.0-blue.svg"
alt="Version: 3.4.0">
</a>
<img src="https://img.shields.io/badge/Swift-5.1-FFAC45.svg" alt="Swift: 5.1">
<img src="https://img.shields.io/badge/Platforms-iOS%20%7C%20tvOS%20%7C%20macOS%20%7C%20Linux-FF69B4.svg"
Expand Down Expand Up @@ -232,6 +232,28 @@ let unicodeString = "Hello composed unicode symbols! 👨‍👩‍👧‍👦
unicodeString[unicodeString.fullRange] // => same string
```

#### .encrypted(key:)

Encrypts this plain text `String` with the given key using AES.GCM and returns a base64 encoded representation of the encrypted data.
`@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)`

``` Swift
let key = SymmetricKey(size: .bits256)

let plainText = "Harry Potter is a 🧙"
let encryptedString = try plainText.encrypted(key: key) // => "nz9LDkTNUEFj16Hrqvs4oCYeuIgV+nSP4OSqahkbtH62eJHHW664wC8NeFAMBPq7ZsY="
```

#### .decrypted(key:)

Decrypts this base64 encoded representation of encrypted data with the given key using AES.GCM and returns the decrypted plain text `String`.
`@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, *)`

``` Swift
encryptedString.decrypt(key: key) // => "Harry Potter is a 🧙"
```


### NSRangeExtension

#### init(_:in:)
Expand Down Expand Up @@ -608,7 +630,7 @@ foo2.isEasy // => true

## Donation

BartyCrouch was brought to you by [Cihat Gündüz](https://github.com/Jeehut) in his free time. If you want to thank me and support the development of this project, please **make a small donation on [PayPal](https://paypal.me/Dschee/5EUR)**. In case you also like my other [open source contributions](https://github.com/Flinesoft) and [articles](https://medium.com/@Jeehut), please consider motivating me by **becoming a sponsor on [GitHub](https://github.com/sponsors/Jeehut)** or a **patron on [Patreon](https://www.patreon.com/Jeehut)**.
HandySwift was brought to you by [Cihat Gündüz](https://github.com/Jeehut) in his free time. If you want to thank me and support the development of this project, please **make a small donation on [PayPal](https://paypal.me/Dschee/5EUR)**. In case you also like my other [open source contributions](https://github.com/Flinesoft) and [articles](https://medium.com/@Jeehut), please consider motivating me by **becoming a sponsor on [GitHub](https://github.com/sponsors/Jeehut)** or a **patron on [Patreon](https://www.patreon.com/Jeehut)**.

Thank you very much for any donation, it really helps out a lot! 💯

Expand Down
Loading

0 comments on commit 5d6a6df

Please sign in to comment.