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
/* Experimenting with creating a signature to make it easier to do the server-side development. | |
See https://github.com/cloudinary/cloudinary_java/blob/master/cloudinary-core/src/main/java/com/cloudinary/Cloudinary.java#L129 | |
and https://support.cloudinary.com/hc/en-us/articles/203817991-How-to-generate-a-Cloudinary-signature-on-my-own- | |
*/ | |
// The optional timestamp is for testing this method-- this should be a UNIX timestamp with no trailing decimals-- i.e., just an integer number. | |
// Don't use "public_id" or "timestamp" as keys in otherParams if you give it. | |
func createSignature(publicId: String, apiSecret: String, otherParams: [String: Any]? = nil, timestamp: String? = nil) -> (signature: String, timestamp: String)? { | |
// 1) Set up the parameters we're going to use in the signing. | |
var params = [String: Any]() |
NewerOlder