Guest User

Untitled

a guest
Jan 12th, 2023
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.87 KB | None | 0 0
  1. from base64 import b64encode
  2. import js2py
  3.  
  4. def get_fingerprint_hash(data):
  5.     s = js2py.eval_js('''getFingerPrintHash = function(t) {
  6. var Ra = '1.2.0'
  7. var Ta = function(e, t) {
  8.    if (t < 1)
  9.        return "";
  10.    if (t % 2)
  11.        return Ta(e, t - 1) + e;
  12.    var n = Ta(e, t / 2);
  13.    return n + n
  14. }
  15. var fnv32a = function(e, t) {
  16.    for (var n = 0; n < e.length; n++){
  17.        t = 16777619 * (t ^= e.charCodeAt(n)) & 4294967295;
  18.    }
  19.    return t
  20. }
  21. var tobinary = function(e) {
  22.    for (var t = "", n = 0; n < 4; n++)
  23.        t += String.fromCharCode(255 & e),
  24.    e >>= 8;
  25.    return t
  26. }
  27. var n = 1471357547 + Number(Ra.split(".").map((function(e) {
  28. return Ta("0", 2 - e.length) + e
  29. }
  30. )).join(""))
  31. , r = fnv32a(t.substr(0, t.length / 2), 2166136261)
  32. , o = fnv32a(t.substr(t.length / 2), r);
  33. o = 4294967040 & o | 1;
  34. var i = "";
  35. i += tobinary(4004)
  36. i += tobinary(n)
  37. i += tobinary(r)
  38. i += tobinary(o)
  39. i += String.fromCharCode(0)
  40. return i
  41. }''')
  42.     return b64encode(s(data).encode())
  43.  
  44. print(get_fingerprint_hash('[{"UserAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.76"},{"browser":{"browser":"Edge","mobile":false,"version":"108.0.1462.76"},"screen":{"availableSize":{"height":824,"width":1536},"colorDepth":24,"pixelRatio":1.25,"size":{"height":864,"width":1536}},"system":{"name":"Windows 10","version":"10"}},{"UserLanguage":"ru"},{"TimezoneOffset":-420},{"Plugins":["Chrome PDF Viewer::Portable Document Format::application/pdf~pdf,text/pdf~pdf","Chromium PDF Viewer::Portable Document Format::application/pdf~pdf,text/pdf~pdf","Microsoft Edge PDF Viewer::Portable Document Format::application/pdf~pdf,text/pdf~pdf","PDF Viewer::Portable Document Format::application/pdf~pdf,text/pdf~pdf","WebKit built-in PDF::Portable Document Format::application/pdf~pdf,text/pdf~pdf"]}]').decode())
Add Comment
Please, Sign In to add comment