{"action":"created","issue":{"url":"https://api.github.com/repos/ngerakines/commitment/issues/108","labels_url":"https://api.github.com/repos/ngerakines/commitment/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/ngerakines/commitment/issues/108/comments","events_url":"https://api.github.com/repos/ngerakines/commitment/issues/108/events","html_url":"https://github.com/ngerakines/commitment/issues/108","id":96625731,"number":108,"title":"Use arbitrary hash to select commit message.","user":{"login":"emallson","id":4909458,"avatar_url":"https://avatars.githubusercontent.com/u/4909458?v=3","gravatar_id":"","url":"https://api.github.com/users/emallson","html_url":"https://github.com/emallson","followers_url":"https://api.github.com/users/emallson/followers","following_url":"https://api.github.com/users/emallson/following{/other_user}","gists_url":"https://api.github.com/users/emallson/gists{/gist_id}","starred_url":"https://api.github.com/users/emallson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emallson/subscriptions","organizations_url":"https://api.github.com/users/emallson/orgs","repos_url":"https://api.github.com/users/emallson/repos","events_url":"https://api.github.com/users/emallson/events{/privacy}","received_events_url":"https://api.github.com/users/emallson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-22T17:47:35Z","updated_at":"2015-07-22T17:57:09Z","closed_at":null,"body":"git uses SHA1 hashes for content. It would be nice if we could request contents based on those hashes (or other content, really) in a deterministic way.\r\n\r\nBecause the hashes used by commitment are generated based on message content, what would be needed is an inexpensive deterministic way to map from the set of all strings to the set of MD5 hashes used by this project.\r\n\r\nA deterministic, time-bounded way to do this would be by initializing a random number generator with the numeric representation of the SHA1 / MD5 hash, then sampling from `messages` with that RNG. Given that it'd always be seeded in the same way, this would be deterministic and O(1). Since we don't need crypto-level hash guarantees, this ought to be sufficient.\r\n\r\nThe request would look like:\r\n\r\nGET http://whatthecommit.com/[index.txt]?content-hash=md5sum\r\n\r\nwith responses the same as they are presently.\r\n\r\nThoughts on adding this? I'm going to look into submitting a PR to do this this weekend."},"comment":{"url":"https://api.github.com/repos/ngerakines/commitment/issues/comments/123808796","html_url":"https://github.com/ngerakines/commitment/issues/108#issuecomment-123808796","issue_url":"https://api.github.com/repos/ngerakines/commitment/issues/108","id":123808796,"user":{"login":"ngerakines","id":12125,"avatar_url":"https://avatars.githubusercontent.com/u/12125?v=3","gravatar_id":"","url":"https://api.github.com/users/ngerakines","html_url":"https://github.com/ngerakines","followers_url":"https://api.github.com/users/ngerakines/followers","following_url":"https://api.github.com/users/ngerakines/following{/other_user}","gists_url":"https://api.github.com/users/ngerakines/gists{/gist_id}","starred_url":"https://api.github.com/users/ngerakines/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngerakines/subscriptions","organizations_url":"https://api.github.com/users/ngerakines/orgs","repos_url":"https://api.github.com/users/ngerakines/repos","events_url":"https://api.github.com/users/ngerakines/events{/privacy}","received_events_url":"https://api.github.com/users/ngerakines/received_events","type":"User","site_admin":false},"created_at":"2015-07-22T17:57:09Z","updated_at":"2015-07-22T17:57:09Z","body":"So, you are saying that you want to be able to provide a seed (referred to as \"content-hash\") to the random number generator used to select which message to display. This would allow the same message to be returned with subsequent calls using the same seed.\r\n\r\n:+1:"}}