Retrieving fingerprint of data from the web browser using getHASH

Description

This function allows you to compute and retrieve a hash of the web browser properties of the device (fingerprint hash).

This fingerprint hash must not be considered as a reliable unique device identifier. Indeed, two similar browsers on two similar devices might return the same fingerprint hash.

Different fingerprint hashes, however, provide reliable information about the potential usage of two different devices.

The optional Boolean parameter includeViewport (with false as the default value) specifies whether the following, highly volatile, values will be retrieved:

  • Browser window width
  • Browser window height

If includeViewport is set to true, the same device or browser will send different fingerprint values, and will therefore be considered as different devices or browsers.

OneSpan highly recommends not setting includeViewport to true when retrieving the fingerprint hash to prevent devices from being considered different while changing the size of the browser window.

Examples

CDDC JavaScript for modern UI and React framework:

  1. //Retrieve fingerprint hash and store it into React state variable
  2. import React,{ Component } from 'react';
  3. //including reference to CDDC JavaScript
  4. import { getHASH } from '../lib/cddc.esm';
  5.  
  6. class Test extends Component {
  7.   constructor(props){
  8.     super(props);
  9.  
  10.     this.state = {
  11.       fingerPrintHash: ''
  12.     };
  13.   }
  14.   componentDidMount() {
  15.     //Retrieve browser fingerprint hash, without viewport information
  16.     const fingerPrintHash = getHASH(false);
  17.     this.setState({
  18.       fingerPrintHash: fingerPrintHash
  19.     });
  20.   }
  21. }
  22. export default Test

Legacy CDDC JavaScript:

  1. //Retrieve fingerprint hash and write it into input box
  2. //#TextAreaCDDCFingerPrintJSon'
  3. $('#TextAreaCDDCFingerPrintJSon').val($.Vasco.getHASH(false));

Example of function result:

1d4c39e5dbc24e399bd27628983e17bb75b9761849bc26ac2f361ceab59e5eb5