-
Notifications
You must be signed in to change notification settings - Fork 296
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
iPhone真机生成uuid报错 #1
Comments
安卓也无法生成。 |
好吧那只好放弃用这个库了,谢谢 @byg |
提供一个算法: /**
* Returns a v4 compliant UUID.
*
* @returns {string}
*/
export default function uuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
const r = (Math.random() * 16) | 0,
v = c === 'x' ? r : (r & 0x3) | 0x8;
return v.toString(16);
});
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
var uuidTool = require('/utils/node-uuid/uuid.modified.js');
uuid = uuidTool.v4();
The text was updated successfully, but these errors were encountered: