Commit 23ff8624 authored by Ujvari Gergely's avatar Ujvari Gergely

Using broofa/node-uuid uuid library

For better random generation
parent aa3b3a1d
......@@ -16,7 +16,9 @@ class Displayer
this.$inject = ['$scope','$element','$timeout','streamfilter']
constructor: ($scope, $element, $timeout, streamfilter) ->
# Generate client ID
@clientID = UUIDjs.create().toString()
buffer = new Array(16)
uuid.v4 null, buffer, 0
@clientID = uuid.unparse buffer
$scope.root = document.init_annotation
$scope.annotation = $scope.root.annotation
......
......@@ -56,7 +56,9 @@ class Hypothesis extends Annotator
super ($document.find 'body')
# Generate client ID
@clientID = UUIDjs.create().toString()
buffer = new Array(16)
uuid.v4 null, buffer, 0
@clientID = uuid.unparse buffer
$.ajaxSetup headers: "x-client-id": @clientID
# Load plugins
......
......@@ -27,7 +27,9 @@ class Stream
filterClause = 'user:i=' + $scope.filterValue
# Generate client ID
@clientID = UUIDjs.create().toString()
buffer = new Array(16)
uuid.v4 null, buffer, 0
@clientID = uuid.unparse buffer
$scope.filter =
streamfilter
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment