特定网站的哈希函数是什么[已关闭]

问题描述 投票:0回答:0

我一直在尝试从网站上理解和复制Python中的哈希函数。网站链接是 https://instantdomainsearch.com/domain/extensions?q=labscapital

搜索此网址时,网站会发送一些请求。它们看起来和这个很相似。

https://instantdomainsearch.com/services/zone-names/labscapital?hash=817418168&limit=1000&city=San+Francisco&country=US&tldTags=all

这就是我想要的哈希

哈希=817418168

我只知道它会随着搜索查询而变化,即此处的 labscapital。 我搜索并找到了一些可能有帮助的东西。

a = n(80833)
c = n(37817)

80833模块如下

    80833: function (e, t, n) {
      "use strict";
      n.d(t, {
        HZ: function () {
          return a;
        },
        ZT: function () {
          return o;
        },
        ej: function () {
          return s;
        },
        un: function () {
          return r;
        },
        yo: function () {
          return i;
        },
      });
      let r = function (e) {
          let t =
              arguments.length > 1 && void 0 !== arguments[1]
                ? arguments[1]
                : 0,
            n = t;
          for (let t of e) (n = (n << 5) - n + t.codePointAt(0)), (n &= n);
          return String(n);
        },
        i = function (e) {
          let t =
              arguments.length > 1 && void 0 !== arguments[1]
                ? arguments[1]
                : 1,
            n = [];
          for (; e.length > 0; ) {
            let r = e.splice(0, t);
            n.push(r);
          }
          return n;
        },
        o = () => {},
        a = () => "403964ec2e184b930da2c298ff2cf358c1353b68",
        s = (e) => {
          let t = "; ".concat(document.cookie),
            n = t.split("; ".concat(e, "="));
          if (2 === n.length) {
            let e = n.pop();
            if (e) return e.split(";").shift();
          }
        };
}

37817模块如下

    37817: function (e, t, n) {
      "use strict";
      n.d(t, {
        $4: function () {
          return u;
        },
        $h: function () {
          return v;
        },
        GZ: function () {
          return p;
        },
        NZ: function () {
          return c;
        },
        QS: function () {
          return a;
        },
        VT: function () {
          return s;
        },
        Wb: function () {
          return d;
        },
        Wx: function () {
          return h;
        },
        lR: function () {
          return l;
        },
        tf: function () {
          return m;
        },
        v2: function () {
          return o;
        },
        x8: function () {
          return f;
        },
      });
      var r = n(58158),
        i = n(34406);
      let o =
          i.env.NEXT_PUBLIC_CLOUD_HOST || "https://instantdomainsearch.com/",
        a = "http://localhost:3000/",
        s = "".concat(a, "services/dev/sink"),
        c = r.yv ? "production" : "development",
        u = 27,
        l = 42,
        d = !0,
        f = {
          development: { URL: "https://instantdomainsearch.com" },
          production: { URL: "https://instantdomainsearch.com" },
          staging: { URL: "https://instantdomainsearch.com" },
          test: { URL: "https://instantdomainsearch.com" },
        },
        p =
          '{\n  "@context": "https://schema.org/",\n  "@type": "WebSite",\n  "name": "Instant Domain Search",\n  "url": "https://instantdomainsearch.com",\n  "potentialAction": {\n    "@type": "SearchAction",\n    "target": "https://instantdomainsearch.com/?q={search_term_string}",\n    "query-input": "required name=search_term_string"\n  }\n}',
        h =
          '{\n  "@context": "https://schema.org",\n  "@type": "Corporation",\n  "logo": "https://instantdomains.com/logo.svg",\n  "name": "Instant Domains, Inc.",\n  "url": "https://instantdomains.com",\n  "sameAs": [\n    "https://github.com/instant-labs",\n    "https://twitter.com/instant_ca",\n    "https://www.facebook.com/InstantDomainSearch",\n    "https://www.linkedin.com/company/instant_ca"\n  ]\n}',
        m = "".concat(o, "services/history/"),
        v = "".concat(o, "services/screenshot/");
    }

concat 使用 a.un 和 c.lR 中的值来生成哈希值

h = (e, t) =>
          ""
            .concat(c.tf)
            .concat(encodeURIComponent(e), "/")
            .concat(encodeURIComponent(t), "?hash=")
            .concat((0, a.un)(e, c.lR))

我不知道 e 的值是什么,也不知道它在网站中是如何调用的。我只是在搜索与哈希相关的关键字并找到了所有这些。 我从以下 JS 文件中找到了这段代码。 https://instantdomainsearch.com/_next/static/chunks/2481.1b1cb654d09d0bd1.js

现在我的问题是这个哈希是如何生成的,幕后发生了什么。什么被作为 e 传递(调试网站但失败)。我对 JS 不太了解,需要准确了解哈希是如何生成的,换句话说,它是如何工作的。我必须在理解它之后将其转换为Python。
我花了很多时间但失败了,因为我没有足够的 JS 经验和理解。 预先感谢您的帮助。

javascript python hash cryptography
© www.soinside.com 2019 - 2024. All rights reserved.