Code Monkey home page Code Monkey logo

Comments (1)

barjin avatar barjin commented on June 14, 2024

Hi @tenkuken, the fingerprint-suite tools are based on a random generator - therefore, there is no straightforward way how to generate non-redundant data. This, however, doesn't mean you cannot get a list of non-duplicate user-agents - you just have to deal with it in your own code. Here is an example of how you can do this:

const { HeaderGenerator } = require('header-generator');
const headerGenerator = new HeaderGenerator();

const userAgents = {};

for (let i = 0; i < 1e4; i++) {
    const userAgent = headerGenerator.getHeaders()['user-agent'];
    userAgents[userAgent] = true;
}

console.log(Object.keys(userAgents)); 

In this snippet, we generate 10000 header sets and deduplicate the user agents by using them as keys in a JavaScript object.

Please note that the looser constraints you set for the generator (by removing the 'locales', 'operatingSystems' or 'devices' options from the getFingerprint() call), the more distinct user-agent strings the generator will be able to generate.


A very important footnote:

If you really need only the user-agent strings (or some other HTTP headers) you'll be much better off with using HeaderGenerator instead of FingerprintGenerator. Here is a graph of run times for the script above using different tools to generate user-agent strings:

obrazek

You see that the header-generator (in my snippet above) is the fastest option with an average run time of just under 2 seconds, and the fingerprint-generator option (from your snippet) is the slowest one with 8s. This is because the fingerprint-generator uses a much larger model for generating not only the user-agent string but also screen dimensions, different Web API values, etc.

Feel free to use the script I provided above :)

I'll close this issue as wontfix, but feel free to ask additional questions if you get any.

from fingerprint-suite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.