Click here to Skip to main content
15,909,897 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
i mean when i write any string
i get the out put as 0's and 1's with fixed length equal 64
how i can do that using C#?

i mean when i write "hello" i get a stream of 0's and 1's of length 64 in any array type

when i write "hi" i get a stream of 0's and 1's of length 64 in any array type

i want to get fixed length of bits =64 ignoring the length of input string which may take one word or a paragraph
Posted
Updated 30-Mar-13 8:53am
v2
Comments
Sergey Alexandrovich Kryukov 29-Mar-13 20:42pm    
What have you done so far? How do you want to represent bits (as another string like "1010101001110", or array of bytes, which is the real binary data), what?
—SA
hallo2012 30-Mar-13 8:01am    
i mean when i write "hello" i get a stream of 0's and 1's of length 64 in any array type
when i write "hi" i get a stream of 0's and 1's of length 64 in any array type
PIEBALDconsult 30-Mar-13 11:11am    
"hello" is five characters, at 16 bits each, which is 80 bits -- which ones do you want to ignore? Or do you want a hash?
hallo2012 30-Mar-13 14:52pm    
yes i see something like hash where it's output is fixed
PIEBALDconsult 30-Mar-13 11:12am    
Are you and this guy http://www.codeproject.com/Messages/4528623/Re-programming-ideas.aspx in the same class?

1 solution

I'm not a fan of Convert, but it has Convert.ToString (Int32, Int32)[^]
 
Share this answer
 
Comments
[no name] 29-Mar-13 21:47pm    
Good one.
hallo2012 30-Mar-13 10:19am    
i try it but it didn't make what i want

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900