Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
Vereign Client Library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Code
Vereign Client Library
Commits
5c081211
Commit
5c081211
authored
6 years ago
by
Markin Igor
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug with creation of device hash.
parent
8d4674be
No related branches found
No related tags found
1 merge request
!14
138 information for devices clients
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
javascript/src/utilities/appUtility.js
+3
-2
3 additions, 2 deletions
javascript/src/utilities/appUtility.js
with
3 additions
and
2 deletions
javascript/src/utilities/appUtility.js
+
3
−
2
View file @
5c081211
...
...
@@ -4,8 +4,9 @@ export const createDeviceHash = async (publicKey) => {
try
{
const
stringToEncode
=
publicKey
+
navigator
.
userAgent
;
const
crypto
=
getCrypto
();
const
buffer
=
new
window
.
TextEncoder
(
"
utf-8
"
).
encode
(
stringToEncode
);
return
window
.
btoa
(
await
crypto
.
digest
({
name
:
"
SHA-1
"
},
buffer
));
const
buffer
=
new
window
.
TextEncoder
().
encode
(
stringToEncode
);
const
hash
=
await
crypto
.
digest
({
name
:
"
SHA-1
"
},
buffer
);
return
window
.
btoa
(
String
.
fromCharCode
(...
new
Uint8Array
(
hash
)));
}
catch
(
error
)
{
console
.
warn
(
error
);
// eslint-disable-line no-console
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment