-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add window.crypto.getRandomValues test #1076
Conversation
|
||
*/ | ||
define(['Modernizr'], function( Modernizr ) { | ||
Modernizr.addTest('getrandomvalues', 'getRandomValues' in window.crypto); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work if window.crypto
is undefined. You want
'crypto' in window && 'getRandomValues' in window.crypto
Thanks for the pull! Could you check out the failing tests and fix them up? |
Oh, sorry. Fixed. |
I'd love to have the polyfill if we are adding a test, so you don't have to remove it you can add it to lib/polyfills.json |
When you are all good to go, could you squish everything down to a single commit, too? Thanks again! |
Done. I found another polyfill (PolyCrypt), because NfWebCrypto seems to doesn't support getRandomValues (and it's a plugin for Chrome, not just a js library). |
Add window.crypto.getRandomValues test
thanks! |
/*! | ||
{ | ||
"name": "Web Cryptography API getRandomValues method", | ||
"property": "window.crypto.getRandomValues", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, this key/value pair is failing grunt-modernizr
testing. I think the value should be "getrandomvalues", right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dangit - yes. Sorry about that richard
fixing it now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in d3a358d
Add window.crypto.getRandomValues test
https://dvcs.w3.org/hg/webcrypto-api/raw-file/tip/spec/Overview.html#RandomSource-method-getRandomValues