BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the BWH community, you simply need to register an account or log into an existing one.

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can probably see and download most content provided for regular members even without an account.

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup

Join the forum, it's quick and easy

BullyWiiHacks
Welcome dear guest! Very Happy

To start posting and being part of the BWH community, you simply need to register an account or log into an existing one.

If you do not wish to register at all, that's fine but there will be more advertisements. :/

You can probably see and download most content provided for regular members even without an account.

Your contributions will be greatly appreciated though, give it a shot and register today! thumbsup
BullyWiiHacks
Would you like to react to this message? Create an account in a few clicks or log in to continue.
BullyWiiHacks

Gaming, Modding & Programming

Important reminders:

- Click *HERE* for advanced forum search or check out the text field below on the front page for Google before posting
- NO support via private message (use the forum)
- Write meaningful topic titles
Site Translation
Latest topics
» Dropped Out of College to Pursue Web Dev and Life Pursuits in General
Need Help With Java - ASCII to HEX Apache Common Codecs Empty4/7/2024, 2:34 pm by SnB@BWH

» Bully Made It Into a BIG Video 400K Views
Need Help With Java - ASCII to HEX Apache Common Codecs Empty4/7/2024, 6:58 am by Bully@WiiPlaza

» Wii Play Tanks
Need Help With Java - ASCII to HEX Apache Common Codecs Empty3/24/2024, 2:46 pm by helpmeout

» [Bypass Paywalls] (Global) @magnolia1234 - GitLab
Need Help With Java - ASCII to HEX Apache Common Codecs Empty3/18/2024, 3:55 am by Seth@WiiPlaza

» [Download] Mary Shelley's Frankenhole
Need Help With Java - ASCII to HEX Apache Common Codecs Empty3/16/2024, 8:29 am by Seth@WiiPlaza

» Completely Custom Modded Controllers (Undetectable)
Need Help With Java - ASCII to HEX Apache Common Codecs Empty3/5/2024, 1:55 pm by Shadow@BWH

» (Zombies) Drink perks code?
Need Help With Java - ASCII to HEX Apache Common Codecs Empty3/5/2024, 1:24 pm by Shadow@BWH

» Die Rückkehr zu STEAM und WARFACE
Need Help With Java - ASCII to HEX Apache Common Codecs Empty3/2/2024, 3:54 am by Seth@WiiPlaza

» First person hand model change?
Need Help With Java - ASCII to HEX Apache Common Codecs Empty2/28/2024, 4:53 am by Ad3lamac611

» {RELEASE} Field Raider Firefox v1.72 by Seth@WiiPlaza
Need Help With Java - ASCII to HEX Apache Common Codecs Empty2/21/2024, 8:52 am by naxil

Search
 
 

Display results as :
 


Rechercher Advanced Search

May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  

Calendar Calendar

Country Statistics
Free counters!

You are not connected. Please login or register

Need Help With Java - ASCII to HEX Apache Common Codecs

2 posters

Go down  Message [Page 1 of 1]

Reclaimer Shawn

Reclaimer Shawn
Code Creator

Hello guys. In NetBeans IDE, I've placed common-codec-1.10.jar in my libraries. Whenever placing this method in my code
Code:

public static String toHex(String ascii)
 {
 return Hex.encodeHexString(text.getBytes());
 }

It tells me that class, enum, or interface expected, and whenever placing
return Hex.encodeHexString(text.getBytes()); in my code, it makes me import org.apache.commons.codec.binary.Hex;
It tells me I need to change method return type to Hex, and it doesn't work for me. I got this information from here: http://www.bullywiihacks.com/t4108-ascii-hex-dec-conversions#22788

How would I use the above code to get Text From a Text Field and then convert the Text Values to Hex, and then print them?
I assume after I get the code to work, I can place said HEX in a string, store different parts of it in variables, and then have it print where I need to. This will basically be finishing my entire program(except the comboboxes, I'll get to that later) as I already got Dec to Hex Conversion and Dec to Bin conversion thanks to these lines of code:
Code:

Integer.toString(variable , X)
X = 2 or 16 depending on which value I needed to return
Thanks for replying, and sorry for being a newb.

Reclaimer Shawn

Reclaimer Shawn
Code Creator

I solved my own problem! Although it required me making tons of if...else if statements and declaring over 100 variables, I created my own little ASCII to Hex Converter inside of my program. It sucked, but it'll work!

Bully@WiiPlaza

Bully@WiiPlaza
 
 

Lol, there are libraries for all these things of course so you literally don't have to do anything.

Reclaimer Shawn

Reclaimer Shawn
Code Creator

I knew that, I just didn't know how to use the function after implementing the library. I got impatient waiting, and was antsy to finish the program, so I just made it myself :p

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum