Skip to content

Commit

Permalink
Cleanup private func name
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewBarba committed Feb 15, 2023
1 parent b0432fa commit d1984f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Vercel/JWT/JWT.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public struct JWT: Sendable {

let input = "\(_header).\(_payload)"

let signature = try hmacSignature(input, secret: secret, using: algorithm)
let signature = try generateSignature(input, secret: secret, using: algorithm)

let _signature = try base64UrlEncode(signature)

Expand Down Expand Up @@ -204,7 +204,7 @@ private func encodeJWTPart(_ value: [String: Any]) throws -> String {
return try base64UrlEncode(data)
}

private func hmacSignature(_ input: String, secret: String, using algorithm: JWT.Algorithm) throws -> Data {
private func generateSignature(_ input: String, secret: String, using algorithm: JWT.Algorithm) throws -> Data {
switch algorithm {
case .hs256:
return Crypto.Auth.code(for: input, secret: secret, using: .sha256)
Expand Down

0 comments on commit d1984f3

Please sign in to comment.