0

what is type this encoding? "\x73\164\x6f\x72\141\147\145\x3a\154\x69\x6e\153"

How to encode "storage:link" string as above encode?

3
  • Does this answer your question? Convert Hex Code into readable string in PHP Commented Jun 13, 2021 at 15:10
  • @HafezDivandari no i've already read this question Commented Jun 13, 2021 at 15:18
  • i want how to convert string to this encoding not decode Commented Jun 13, 2021 at 15:19

1 Answer 1

1

Your string is a mixture of hexadecimal and octal representation of "storage:link":

\x73\164\x6f\x72\141\147\145\x3a\154\x69\x6e\153
  ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^
 hex oct hex hex oct oct oct hex oct hex hex oct

According to this comment, you may convert your binary string into hex represented text like this:

$hexStr = bin2hex("storage:link");       // 73746f726167653a6c696e6b
$hexStr = chunk_split($hexStr, 2, '\x'); // 73\x74\x6f\x72\x61\x67\x65\x3a\x6c\x69\x6e\x6b\x
$hexStr = '\x' . substr($hexStr, 0, -2); // \x73\x74\x6f\x72\x61\x67\x65\x3a\x6c\x69\x6e\x6b

The final output would be:

\x73\x74\x6f\x72\x61\x67\x65\x3a\x6c\x69\x6e\x6b
  ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^
 hex hex hex hex hex hex hex hex hex hex hex hex
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.