Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to write algorithm in php? #2

Closed
emma-eva opened this issue Nov 23, 2021 · 2 comments
Closed

Is it possible to write algorithm in php? #2

emma-eva opened this issue Nov 23, 2021 · 2 comments

Comments

@emma-eva
Copy link

Just this algorithm i need in php.

def OOOOO(__0):
    try:
        __0, OOO = __0.split("."), "0123456789/:abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
        __0 = {"header": loads(b64decode(f"{__0[0]}=======").decode("utf-8")),"payload": loads(b64decode(f"{__0[1]}=======").decode("utf-8")),"raw": {"header": __0[0], "payload": __0[1], "signature": __0[2]}}

        def OO(__):
            for _ in range(len(__) - 1, -1, -1):
                if __[_] < len(OOO) - 1:
                    __[_] += 1;return True
                __[_] = 0
            return False

        def OOO0(__):
            _ = ""
            for ___ in range(len(__)): _ += OOO[__[___]]
            return _

        def O0OO(_, __):
            _00O, _OO0 = [], sha1(__.encode()).digest()
            for n in range(0, 160): _00O.append(_OO0[-1] >> 1)
            def _i(O00O, O000):
                if O000 in O00O: return O00O.index(O000)
                return -1
            return 0 == _00O[:_][0] and _i(_00O[:_], 1) >= _ - 1 or -1 == _i(_00O[:_], 1)

        def OO0OO():
            for e in range(25):
                n = [0 for i in range(e)]
                while OO(n):
                    if O0OO(__0["payload"]["s"], f'{__0["payload"]["d"]}::{OOO0(n)}'): return OOO0(n)
        return ":".join(["1", str(__0["payload"]["s"]),datetime.now().isoformat()[:19].replace("T", "").replace("-", "").replace(":", ""), __0["payload"]["d"], "", str(OO0OO())])
    except: pass

Can you help me to convert that code in php?

@emma-eva
Copy link
Author

No longer need it

@JokersCat
Copy link

Oh why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants