Skip to content

Instantly share code, notes, and snippets.

@spolu
Created May 3, 2012 10:16
Show Gist options
  • Save spolu/2584876 to your computer and use it in GitHub Desktop.
Save spolu/2584876 to your computer and use it in GitHub Desktop.
S3ObjectRequest *thumbReq = [S3ObjectRequest PUTRequestForData:thumbJPEG
withBucket:@"teleportd-data"
key:[NSString stringWithFormat:@"/%d-%d/%@.jpg",
(dnow / 86400), (dnow % 86400) / 3600,
thumbSHA1, nil]];
//...
PipeMsg *thumbMsg = [PipeMsg msgWithType:PipeMsgType2w
target:[NSString stringWithFormat: @"user.%@", [Pipe user], nil]
subject:@"ACC:S3SIGN"
body:[NSDictionary dictionaryWithObject:[thumbReq stringToSign]
forKey:@"strsign"]];
var secretKey = 'XXX';
var hmac = require('crypto').createHmac("sha1", secretKey);
hmac.update('' + my.action.body().strsign);
var sign = hmac.digest(encoding='base64');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment