N
N
NokianNordman2021-06-11 15:15:24
PHP
NokianNordman, 2021-06-11 15:15:24

Explain 3 lines when please?

Hey! Help me understand how the string looks like in the end, which should be encoded in sha1.

I ’ll take the host, for example: https://habr.com
As I understand it: the host is taken, the last 2 characters are cut off and the text is formed: habr.ctext1234 Do

I understand correctly or is something wrong?

$host = explode(".", $_SERVER["HTTP_HOST"]);
$host_name = trim($host[count($host) - 2] . "." . end($host), ".");
include DLEPlugins::Check(ENGINE_DIR . "/modules/nokian/config.php");
$key = strtoupper(sha1($host_name . "text" . "1234"));

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
v3shin, 2021-06-11
@NokianNordman

The host is taken, only the main domain + zone is left.
123.qna.habr.com -> habr.com
And then the text is "salted" and hashed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question