About
Community
Bad Ideas
Drugs
Ego
Erotica
Fringe
Society
Technology
register | bbs | search | rss | faq | about
meet up | add to del.icio.us | digg it
Go Back   Community > Technology > Network (in)Security
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Network (in)Security Interesting hacks and cracks. Info on firewalls, TCP/IP, encryption, networks, and security. The ins and outs of the phone system, caller services, how things work, what's illegal and what's not, cellular phones, beepers, telephony legislation, the PUC, ISDN, taps, who's listening, and switches. Talking about phones, hacking systems, technical advice, and such is completely LEGAL in the United States -- it's covered by the First Amendment. What's illegal is conspiracy to commit a crime. So if you say something like "Meet me at 2am so we can crack a can" or "I changed my cell phone's number myself" you are criminally liable. Stating "You can crack a can by doing thus-and-so" or "If you wanted to change a cell phone's number, you could do it like so" is perfectly OK. Posting passwords, calling card numbers, or credit card numbers is forbidden on this network. Posting such info will get you booted off the net.

Reply
 
Thread Tools Display Modes
 #1 
Old 2004-12-22, 06:11
marleyandmarley marleyandmarley is offline
Regular
 
Default Changing Text To char

OK does anyone have a site or know how to change text into chars.

Ex ' is char(39)
 #2 
Old 2004-12-22, 06:49
cense cense is offline
Regular
 
Default Re: Changing Text To char

code:<pre>#!/usr/bin/perl

print("Enter string: ");

my $string = &lt;STDIN&gt;;

while($string =~ /(.)/g) {

$ord = ord($1);

print "$ord ";

}

print "\n";</pre>
 #3 
Old 2004-12-22, 06:53
Eklipze Eklipze is offline
Regular
 
Default Re: Changing Text To char

code:<pre>

#include &lt;iostream&gt;

using namespace std;

int main() {

char input;

for(; ;) {

cout &lt;&lt; "Enter a character to determine it's ascii value: ";

cin &gt;&gt; input;

cout &lt;&lt; "The ascii value of " &lt;&lt; input &lt;&lt; " is " &lt;&lt; int(input) &lt;&lt; endl;

}

return 0;

}

</pre>

EDIT: Cense beat me to it, but at least now you have two different languages to work with.

[This message has been edited by Eklipze (edited 12-22-2004).]
 #4 
Old 2004-12-22, 07:20
marleyandmarley marleyandmarley is offline
Regular
 
Default Re: Changing Text To char

OK so the first one is in pearl and the second is in C++

Anyone got anything in PHP?

Because my site doesnt support perl, and I dont have anything to compile a c++ program.
 #5 
Old 2004-12-22, 13:47
Hush Hush is offline
Regular
 
Default Re: Changing Text To char

code:<pre>

&lt;?php

$char_string = "char(39)";

$chr_string = chr(str_replace("char(","",substr($char_string,0,-1)));

echo $chr_string;

?&gt;

</pre>

Obviously you could set $char_string through user input.
 #6 
Old 2004-12-23, 20:45
caffeine_junky caffeine_junky is offline
Regular
 
Default Re: Changing Text To char

Are you talking abotu inputting strings? if so I believe you could do something like:

code:<pre>

#include &lt;iostream.h&gt;

#include &lt;string.h&gt;

int main()

{

char[20] string;

cout&lt;&lt;"Please enter a string"&lt;&lt;endl;

cin&gt;&gt;string;

cout&lt;&lt;"You entered "&lt;&lt;string;

</pre>

[This message has been edited by caffeine_junky (edited 12-23-2004).]
 
To the best of our knowledge, the text on this page may be freely reproduced and distributed.
 

totse.com certificate signatures
 
 
About | Community | Bad Ideas | Drugs | Ego | Erotica | Fringe | Society | Technology
Hot Topics