Linked Questions
35 questions linked to/from In Java, how do I convert a byte array to a string of hex digits while keeping leading zeros?
831
votes
34
answers
1.1m
views
Java: convert a byte array to a hex string?
I have a byte array filled with hex numbers and printing it the easy way is pretty pointless because there are many unprintable elements. What I need is the exact hexcode in the form of: 3a5f771c
1
vote
2
answers
1k
views
How to convert 160 digit binary string to 20 byte array? [duplicate]
I have a binary string containing 160 digit.
I have tried:
new BigInteger("...
1105
votes
34
answers
1.2m
views
How can I generate an MD5 hash in Java?
Is there any method to generate MD5 hash of a string in Java?
253
votes
14
answers
156k
views
How to convert a color integer to a hex String in Android?
I have an integer that was generated from an android.graphics.Color.
It has a value of -16776961. How do I convert it into a hex string with the format #RRGGBB?
Simply put: I would like to output #...
75
votes
16
answers
99k
views
How to generate an MD5 checksum for a file in Android?
In my app I have a requirement to generate an MD5 checksum for a file. Could you please tell me if there is any way in which this can be achieved?
Thank you.
59
votes
5
answers
75k
views
How can I calculate the SHA-256 hash of a string in Android?
I'm trying to get the SHA256 of a string in Android.
Here is the PHP code that I want to match:
echo bin2hex(mhash(MHASH_SHA256,"asdf"));
//outputs "...
19
votes
3
answers
19k
views
Getting access to media player cache
I want to move a progressively streamed mp3 file to sd card once it is completely loaded. Is there any way of achieving that.
I've seen that the MediaPlayer completely downloads the whole file while ...
4
votes
3
answers
16k
views
String to byte array and then to MD5 in Java
in the last 5 hours im trying to do something that should be very simple and did it in like 10 minutes in C#, but no luck with Java.
I got a 32 UpperCase and Numeric String (A-Z0-9), I need to convert ...
5
votes
4
answers
6k
views
Getting 1 byte extra in the modulus RSA Key and sometimes for exponents also
Here is my code snippet:
int eValue = 79, t;
int bitLength = 1024; // KeySize
BigInteger e = new BigInteger(Integer.toString(eValue));
KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
...
7
votes
3
answers
7k
views
XSLT: Obtaining or matching hashes for base64 encoded data
I need to find a way to find a way to find the hash for the base64 encoded data in the XML node //note/resource/data, or somehow otherwise match it to the hash value in the node //note/content/en-note/...
0
votes
2
answers
7k
views
How to read network stream data in Java (Protocol packets)
Am working on decoding a protocol used by a certain gps device to communicate.
Right now, am analyzing the first data packet that it sends. I am able to read it, but am thinking am not reading it ...
4
votes
1
answer
3k
views
Android content provider protection level & different keys
I have an app available in Pro (paid) & Free (add supported) versions. Both versions are signed with the same key store, but each one with its own key alias.
Now, I'd like to develop a plugin ...
3
votes
2
answers
3k
views
Caching bitmaps without External SD Card
The images will not cache on internal storage and crashes on devices without an External SD Card. I have tried what I know and nothing worked. Here is the ImageCache.java
package com.minecraftpix....
1
vote
3
answers
3k
views
Java MessageDigest result does not stay constant
I've got this function for encrypting passwords in Java, but somehow when I call
MessageDigest, it returns a different result every time even though I call it with the same password. I wonder if I am ...
0
votes
2
answers
2k
views
Issue with MD5 hash generation
I am using following code to generate MD5 Hash for my application it encodes some string value and then I send this generated hash through my web service to some .Net code, that code read my MD5 hash ...