{"action":"created","issue":{"url":"https://api.github.com/repos/servo/servo/issues/6505","labels_url":"https://api.github.com/repos/servo/servo/issues/6505/labels{/name}","comments_url":"https://api.github.com/repos/servo/servo/issues/6505/comments","events_url":"https://api.github.com/repos/servo/servo/issues/6505/events","html_url":"https://github.com/servo/servo/pull/6505","id":91530040,"number":6505,"title":"Implement crypto.getRandomValues()","user":{"login":"ttaubert","id":300895,"avatar_url":"https://avatars.githubusercontent.com/u/300895?v=3","gravatar_id":"","url":"https://api.github.com/users/ttaubert","html_url":"https://github.com/ttaubert","followers_url":"https://api.github.com/users/ttaubert/followers","following_url":"https://api.github.com/users/ttaubert/following{/other_user}","gists_url":"https://api.github.com/users/ttaubert/gists{/gist_id}","starred_url":"https://api.github.com/users/ttaubert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttaubert/subscriptions","organizations_url":"https://api.github.com/users/ttaubert/orgs","repos_url":"https://api.github.com/users/ttaubert/repos","events_url":"https://api.github.com/users/ttaubert/events{/privacy}","received_events_url":"https://api.github.com/users/ttaubert/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/servo/servo/labels/S-awaiting-answer","name":"S-awaiting-answer","color":"d4c5f9"},{"url":"https://api.github.com/repos/servo/servo/labels/S-awaiting-review","name":"S-awaiting-review","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"Ms2ger","id":111161,"avatar_url":"https://avatars.githubusercontent.com/u/111161?v=3","gravatar_id":"","url":"https://api.github.com/users/Ms2ger","html_url":"https://github.com/Ms2ger","followers_url":"https://api.github.com/users/Ms2ger/followers","following_url":"https://api.github.com/users/Ms2ger/following{/other_user}","gists_url":"https://api.github.com/users/Ms2ger/gists{/gist_id}","starred_url":"https://api.github.com/users/Ms2ger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ms2ger/subscriptions","organizations_url":"https://api.github.com/users/Ms2ger/orgs","repos_url":"https://api.github.com/users/Ms2ger/repos","events_url":"https://api.github.com/users/Ms2ger/events{/privacy}","received_events_url":"https://api.github.com/users/Ms2ger/received_events","type":"User","site_admin":false},"milestone":null,"comments":12,"created_at":"2015-06-27T23:51:22Z","updated_at":"2015-06-30T09:57:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/servo/servo/pulls/6505","html_url":"https://github.com/servo/servo/pull/6505","diff_url":"https://github.com/servo/servo/pull/6505.diff","patch_url":"https://github.com/servo/servo/pull/6505.patch"},"body":"Didn't touch mozjs or rust-mozjs because implementing that in the code generator didn't seem too easy. I'm using the same workaround that the TextDecoder does.\r\n\r\nUsing the OsRng should be the right choice here? As the OS keeps state for us we wouldn't need to have a global rng instance to keep around.\r\n\r\nFixes #4666.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/servo/servo/6505)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/servo/servo/issues/comments/117104178","html_url":"https://github.com/servo/servo/pull/6505#issuecomment-117104178","issue_url":"https://api.github.com/repos/servo/servo/issues/6505","id":117104178,"user":{"login":"ttaubert","id":300895,"avatar_url":"https://avatars.githubusercontent.com/u/300895?v=3","gravatar_id":"","url":"https://api.github.com/users/ttaubert","html_url":"https://github.com/ttaubert","followers_url":"https://api.github.com/users/ttaubert/followers","following_url":"https://api.github.com/users/ttaubert/following{/other_user}","gists_url":"https://api.github.com/users/ttaubert/gists{/gist_id}","starred_url":"https://api.github.com/users/ttaubert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttaubert/subscriptions","organizations_url":"https://api.github.com/users/ttaubert/orgs","repos_url":"https://api.github.com/users/ttaubert/repos","events_url":"https://api.github.com/users/ttaubert/events{/privacy}","received_events_url":"https://api.github.com/users/ttaubert/received_events","type":"User","site_admin":false},"created_at":"2015-06-30T09:57:13Z","updated_at":"2015-06-30T09:57:13Z","body":"> I see that @ttaubert made getRandomBytes() take an object, this works for now and lets us throw TypeMismatch, but when ArrayBufferView will be properly implemented, we won't have the occasion to throw it and a TypeError will be thrown by the bindings themselves.\r\n\r\nThe binding throwing TypeError when something other than an ArrayBufferView is passed is fine. We still have to check for an integer array (so no Float32Array for example) and would throw TypeMismatch if we need to."}}