Skip to content
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

Move CID hash generation into worker #1035

Closed
cramforce opened this issue Dec 1, 2015 · 4 comments
Closed

Move CID hash generation into worker #1035

cramforce opened this issue Dec 1, 2015 · 4 comments

Comments

@cramforce
Copy link
Member

More concretely we should generate a binary for https://github.com/ampproject/amphtml/blob/master/third_party/closure-library/sha384-generated.js that can live in a worker and performs signature generation in response to messages.

Eventually we'd have an API like

return new Promise((resolve) => {
  cyptoWorker.postMessage('sha384', messageToSign);
  cryptoWorker.onmessage = function(response) {
    if (response.type == 'sha384' && response.messageToSign == messageToSign) { // or use a message index
      resolve(response.digest)
    }
  };
});

and then get a message event back with the signed

@erwinmombay
Copy link
Member

@cramforce is sha384-generated.js currently built with amp.js/v0.js ?

@cramforce
Copy link
Member Author

No, and it won't be. It'll be build into amp-analytics and while other components will be able to use it, it'll only work if amp-analytics is on the page.

@cramforce
Copy link
Member Author

CC @jridgewell Might be a good project to get started in AMP. Talk to you later!

@rudygalfi rudygalfi added this to the M2 milestone Jan 30, 2016
@rudygalfi rudygalfi modified the milestones: M2, Backlog Mar 4, 2016
@cramforce
Copy link
Member Author

Switched to async API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants