Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from base64 import b64encode
- import js2py
- def get_fingerprint_hash(data):
- s = js2py.eval_js('''getFingerPrintHash = function(t) {
- var Ra = '1.2.0'
- var Ta = function(e, t) {
- if (t < 1)
- return "";
- if (t % 2)
- return Ta(e, t - 1) + e;
- var n = Ta(e, t / 2);
- return n + n
- }
- var fnv32a = function(e, t) {
- for (var n = 0; n < e.length; n++){
- t = 16777619 * (t ^= e.charCodeAt(n)) & 4294967295;
- }
- return t
- }
- var tobinary = function(e) {
- for (var t = "", n = 0; n < 4; n++)
- t += String.fromCharCode(255 & e),
- e >>= 8;
- return t
- }
- var n = 1471357547 + Number(Ra.split(".").map((function(e) {
- return Ta("0", 2 - e.length) + e
- }
- )).join(""))
- , r = fnv32a(t.substr(0, t.length / 2), 2166136261)
- , o = fnv32a(t.substr(t.length / 2), r);
- o = 4294967040 & o | 1;
- var i = "";
- i += tobinary(4004)
- i += tobinary(n)
- i += tobinary(r)
- i += tobinary(o)
- i += String.fromCharCode(0)
- return i
- }''')
- return b64encode(s(data).encode())
- 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