From a24042b49c44d47349d66c98b615be35ed0705b9 Mon Sep 17 00:00:00 2001 From: Christoph Tavan Date: Mon, 19 Dec 2011 17:38:52 +0100 Subject: [PATCH] Avoid 14bit integer overflow in clock_seq --- uuid.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uuid.js b/uuid.js index e39b5c19..02250e57 100644 --- a/uuid.js +++ b/uuid.js @@ -141,7 +141,7 @@ if (msecs < _last) { // Clock regression - Per 4.2.1.2, increment clock seq - _clockSeq++; + _clockSeq = (_clockSeq + 1) & 0x3fff _count = 0; } else { // Per 4.2.1.2, use a count of uuid's generated during the current