couchdb-calculate-session-id
calculates valid CouchDB session IDs using username, salt, secret & timestamp
Example
var calculateSessionId = var sessionId =
Arguments
Argument | Type | Description |
---|---|---|
username | String | name property of \_users doc |
usersalt | String | salt property of \_users doc |
serversecret | String | couch_httpd_auth.secret of CouchDB configuration |
timestamp | Number | Number of seconds elapsed since 1 January 1970 00:00:00 UTC |
How CouchDB does it using Erlang
Credits
All credits due to @christophwitzko, @indutny & @janl: https://gist.github.com/janl/4583f5eb4c0d8216cc5f