Skip to content

Commit a629678

Browse files
author
Jimmy Arts
committed
Linux changes
1 parent cc8193c commit a629678

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/Base64.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Foundation
44
/// URI Safe base64 encode
55
func base64encode(_ input:Data) -> String {
66
let data = input.base64EncodedData(options: NSData.Base64EncodingOptions(rawValue: 0))
7-
let string = NSString(data: data, encoding: String.Encoding.utf8.rawValue) as! String
7+
let string = String(describing: NSString(data: data, encoding: String.Encoding.utf8.rawValue))
88
return string
99
.replacingOccurrences(of: "+", with: "-", options: NSString.CompareOptions(rawValue: 0), range: nil)
1010
.replacingOccurrences(of: "/", with: "_", options: NSString.CompareOptions(rawValue: 0), range: nil)

Sources/JWT.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public func encode(_ payload:Payload, algorithm:Algorithm) -> String {
8181
return nil
8282
}
8383

84-
let header = encodeJSON(["typ": "JWT" as AnyObject, "alg": algorithm.description as AnyObject])!
84+
let header = encodeJSON(["typ": "JWT", "alg": algorithm.description])!
8585
let payload = encodeJSON(payload)!
8686
let signingInput = "\(header).\(payload)"
8787
let signature = algorithm.sign(signingInput)

0 commit comments

Comments
 (0)