-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Remove crypto.randomUUID() from client side #90
Conversation
Unless, if we tries to access the client side page from http protocol, crypto.randomUUID() isn't available.
I got your idea. but it's not safe to use hardcoded messageId. mesaageId should never be duplicated, in any cases. do we have another random way to generate uuid-like messageId? |
Update. it's not limited to be a uuid. any string that not duplicated is acceptable |
from Google. that would be a better choice |
https://www.npmjs.com/package/uuid seems to be a replace choice. to strictly avoid duplicated id, we can add timestamp to the uuid string. |
LGTM! I'll do that in a minute. Thanks for your elaboration! |
@wtlyu I've gone with crypto.getRandomValues(new Uint8Array(1))[0].toString() + Date.now() Will it be sufficient? |
looks good. do you test it? |
Yes it works fine in my env! |
Zhaoyu/profile page
Unless, if we tries to access the client side page from http protocol, crypto.randomUUID() isn't available.