Shell, replacing all characters in the string code?

0 like 0 dislike
7 views
Hi!


Prompt, who knows how all characters in the string to replace them with codes or some hash, by means of command shell.

Here's an example:
At the entrance

> hello world

And the output that is something like

> h2dfde3r443332d



Tried under windows using perl
$ perl -e 'print crypt("hello world", "a3")'


But gave:
The crypt() function is unimplemented due to excessive paranoia. at-e line 1.


In linkuse all works out well.


That's looking for that under windows it was possible with minimal cost just by putting msysGit was possible to perform this task.

upd: had to put ActivePerl.

worked.

but the solution of the problem means sh'll wait.
by | 7 views

2 Answers

0 like 0 dislike
If you need a hash:
$ echo "hello world" | md5sum
6f5902ac237024bdd0c176cb93063dc4 -
by
0 like 0 dislike
str="hello world"; for ((i = 0; i < ${#str}; i++)); do printf '%x' "'$(expr substr "$str" $i 1)'"; done
\r
Replaces all characters in the string code.
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
6 answers
110,608 questions
257,186 answers
0 comments
32,831 users