Skip to content

Instantly share code, notes, and snippets.

@markvanwijnen
Created March 8, 2021 15:38
Show Gist options
  • Select an option

  • Save markvanwijnen/2f89053bba86c013d6f3584324e5b889 to your computer and use it in GitHub Desktop.

Select an option

Save markvanwijnen/2f89053bba86c013d6f3584324e5b889 to your computer and use it in GitHub Desktop.
private func oAuthSignature(httpMethod: String,
baseURLString: String,
parameters: [URLQueryItem],
consumerSecret: String,
oAuthTokenSecret: String? = nil) -> String {
let signatureBaseString = oAuthSignatureBaseString(httpMethod: httpMethod,
baseURLString: baseURLString,
parameters: parameters)
let signingKey = oAuthSigningKey(consumerSecret: consumerSecret,
oAuthTokenSecret: oAuthTokenSecret)
return signatureBaseString.hmacSHA1Hash(key: signingKey)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment