This article provides a summary of five methods to implement globally unique identifiers (UUID) using javascript. This method is comprehensive. If you need it, you can refer to the following global unique identifiers (GUID, globally Unique Identifier) is also called UUID (Universally Unique IDentifier ).
GUID is a 128-bit numeric identifier generated by an algor
Javascript to generate a globally unique identifier (GUID, UUID), guiduuid
A Globally Unique Identifier (GUID, Globally Unique IDentifier) is also called a UUID (Universally Unique Identifier ).
GUID is a 128-bit numeric identifier generated by an algorithm. The GUID format is "xxxxxxxx-xxxx-xxxxxxxxxxxx", where x is a 32-bit hexadecimal number in the range of 0-
You can create a UUID directly online, preview it,This site is good, you can choose the UUID version, you can also directly remove the underline, easy to use Ah, hahahttp://www.uuid.online/On creation of a UUID object, set it ' s initial valuefunction UUID () {this.id = This.createuuid ();} When asked what's this Objec
1.Java development generate UUID or GUID method// 36-bit, with dash // 32-bit, remove the middle dash Java.util.UUID.randomUUID (). toString (). ReplaceAll ("-", "" ");2.Javascript development generate UUID or GUID method/*parameter Middle_line true: with an underscore false without an underscore*/function NewGuid (middle_line) {var length= 32; var result= "";
For example:var a={848b2300c37b4cddb9c633fccb566e5c: "123"};The browser will error, large to mean that 848b2300c37b4cddb9c633fccb566e5c is not a valid property name.See for a long time also did not see what comes, is the length too? Illegal characters?The JSON official does not seem to say this.After searching for JavaScript variable naming rules, the name of a variable in JavaScript cannot be the beginning
Code One:/*! Math.uuid.js (v1.4) http://www.broofa.com mailto:[emailprotected] Copyright (c) Robert Kieffer Dual Licensed Under the MIT and GPL licenses. */* * Generate a random uuid. * * USAGE:MATH.UUID (length, radix) * Length-the desired number of characters * radix-the number of allowable Values for each character. * * EXAMPLES: *//No arguments-returns RFC4122, version 4 ID * >>> math.uuid () * "92329d39-6f5c-452 0-abfc-aab64544e172 "* *//One ar
The globally unique identifier (guid,globally unique Identifier) is also known as the UUID (universally unique Identifier).A GUID is a numeric identifier generated by the algorithm with a binary length of 128 bits. The format of the GUID is "Xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", where X is a 32-bit hexadecimal number in the range of 0-9 or a-f. Ideally, no computer or computer cluster will generate two identical GUIDs.The total number of GUIDs reache
A globally unique identifier (guid,globally unique Identifier) is also known as a UUID (universally unique Identifier).
A GUID is a 128-bit numeric identifier generated by the algorithm in binary length. The GUID is formatted as "Xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", where X is a 32-bit hexadecimal number in the range 0-9 or a-f. Ideally, no computer or cluster of computers will generate two identical GUIDs.
The total number of GUIDs reached 2^128
The following small series will bring you an example of using JS to generate UUID. I think it is quite good. Now I will share it with you and give you a reference. Let's take a look at it with xiaobian.
Example of UUID generation using JS
/*!Math.uuid.js (v1.4)http://www.broofa.commailto:robert@broofa.comCopyright (c) 2010 Robert KiefferDual licensed under the MIT and GPL licenses.*//* * Generate a random uuid. * * USAGE: Math.uuid(length, radix) * length - the desired number of characters * radix - the number of allowable values for each character. * * EXAMPLES: * // No arguments - returns RFC4122, version 4 ID * >>> Math.uuid() * "92329D39-6F5C-4520-ABFC-AAB64544E172" * *
1. view the uuid of liunx
Ll/dev/Disk/by-UUID
D4ec5ce9-f863-452b-ac7f-d9dd0cf32a86-> ../sda3E5bcb376-ec13-46c8-801f-2a51b38372c1-> ../sda1F87c200b-faf1-4d27-a88b-456dd803b047-> ../sda2
========================================================== =
2. view the uuid of SVN on liunx
CD/opt/SVN/apsrc/project1/
Ll
In the directory
Conf
DB
Format
Hooks
Locks
(source, from, range,0, range.length); returnrange; } }UUID Generation ProgramThis build UUID program contains two encodings of Base64 (Urlsafe) and Base58. PackageOrg.noahx.uuid.util;Importorg.apache.commons.codec.binary.Base64;ImportJava.nio.ByteBuffer;ImportJava.util.UUID; Public Abstract classUuidutils { Public StaticString uuid () {
This article comes from http://my.oschina.net/noahxiao/blog/132277, personal storage use1. BackgroundWhen I use Hibernate to do object mapping, I always use the UUID to master the key. Since Hibernate's UUID needs to occupy 32-bit characters, it generally makes people feel more efficient and increase storage usage.When I looked at the company project, I found a better way to build the
The globally unique identifier (guid,globally unique Identifier) is also known as the UUID (universally unique Identifier).A GUID is a numeric identifier generated by the algorithm with a binary length of 128 bits. The format of the GUID is "Xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", where X is a 32-bit hexadecimal number in the range of 0-9 or a-f. Ideally, no computer or computer cluster will generate two identical GUIDs.The total number of GUIDs reache
In the project, you need to change the original id to uuid, so you can directly use the uuid library in boost to generate a uuid.
However, during the test, it was found that the program performance was severely degraded. In the past, 0.6 million pieces of data could be processed per minute, and only about 20 thousand pieces of data could be processed after
I. How to obtain UUID in Linux disk partition 1. # fdisk-lDisk/dev/sda: 1000.2 GB, 1000204886016bytes240heads, 63 sectors/track, 129201 cylindersUnits = cylindersof15120 * 512 = 7741440 bytesSectorsize (logical/physic
I. How to obtain the UUID of a Linux disk partition
1. # fdisk-lDisk/dev/sda: 1000.2 GB, 1000204886016 bytes240 heads, 63 sectors/track, 129201 cylindersUnits = cylinders of 15120*512 = 774144
Note: UUID-universally unique identifiers is a globally unique identifier.
I. How to obtain the uuid of a Linux disk partition
1. [San @ localhost ~] $ LS-L/dev/Disk/by-UUID/ Total 0Lrwxrwxrwx 1 Root 10 2010-01-18 0733f5c1-cb85-4f98-9d4f-122cfcee9806-> http://www.cnblogs.com/sdc1
Lrwxrwxrwx 1 Root 10 2010-01-18 03754-1bdb-> http://www.cnblogs.com/sda5Lrwxrwxrwx 1
1 // discover Asset Primary key 2 @Id3 @GeneratedValue (generator= "System-uuid")4 @ Genericgenerator (name= "System-uuid", strategy= "UUID")5 private Long ID; The GUID is a 128-bit long number, typically represented by a 16 binary. The core idea of the algorithm is to combine the machine's NIC, local time, and a random number to generate the GU
Three ways to view the UUID of a device are summarized below:1 Command view: Blkid2 file Views: Ls-l/dev/disk/by-uuid3 Command view: VOL_ID/DEV/SDA1The role and significance of UUID1: It's really the only signThe UUID provides a unique identification string for the storage device in the system, regardless of the type of device. If you start up in the system and use a drive letter mount, you may not find the
How to generate UUID in PHP, the method of survival uuid.
The code is as follows:
function guid () {if (function_exists (' Com_create_guid ')) {return com_create_guid ();} Else{mt_srand (Double) microtime () *10000)//optional for PHP 4.2.0 and up. $charid = Strtoupper (MD5 (Uniqid (rand (), true) ); $hyphen = CHR;//"-" $uuid = Chr (123)//"{". substr ($charid,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.