-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
3851c78
to
a8aa30e
Compare
a15ebeb
to
cb23f63
Compare
a8aa30e
to
4566430
Compare
4566430
to
b965aca
Compare
const string2ArrayBuffer = (str) => { | ||
let buf = new ArrayBuffer(str.length * 2); // 2 bytes for each char | ||
let bufView = new Uint16Array(buf); | ||
for (let i = 0, strLen = str.length; i < strLen; i++) { | ||
bufView[i] = str.charCodeAt(i); | ||
} | ||
return buf; | ||
}; | ||
|
||
const printArrayBuffer = (buffer) => { | ||
let view = new Uint8Array(buffer); | ||
return Array.from(view); | ||
}; |
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.
Having seen this in a bunch of places at this point - maybe move them to a helper functio( in another PR)?
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.
I was asking myself the same question but ended up this way since I wanted that example to be "completed" (without the need to have multiple files), just copy/run. Do you think it makes sense?
b965aca
to
6ca2bdd
Compare
} | ||
|
||
resolve(rt.NewArrayBuffer(signature)) |
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.
Same problem as in the previous PRs with using the runtime in a goroutine off the event loop
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.
yeah, but I'd like to do this separately (in ~1h I'll push a PR with fixing all methods)
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.
See a draft #75
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.
LGTM if #75 is merged just after this.
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.
LGTM 🚀
What?
This PR is based on #67 and extends support of elliptic curves in xk6-webcrypto.
It brings support to the ECDSA for the following methods:
It also brings the
spki
format support for both ECDH and ECDSA.Why?
Closes: #48
Closes: #70