[android-developers] Re: SHA1
Oh my reply did not post.
I just wrote that it works great with MessageDigest class.
Thanks for the help.
On 26 Sep, 09:46, Nikolay Elenkov <nikolay.elen...@gmail.com> wrote:
> On Mon, Sep 26, 2011 at 4:39 PM, Kristoffer <kris.isak.v...@gmail.com> wrote:
> > Hello.
>
> > Is there a easy way of making asha1from a string in android?
>
> That has actually little to do with Android. For cryptographic
> operations in Java you use the JCE classes:
>
> http://download.oracle.com/javase/6/docs/technotes/guides/security/cr...
>
>
>
> > Right now iam using a a php script that makes it for me and passes the
> >sha1string back to the application.
>
> > its very simple in php:
>
> > echosha1('string1'.'string2');
>
> > But it would be much cleaner if i could make this happen inside the
> > app instead.
>
> Use the MessageDigest class. Just make sure you use a fixed
> charset when converting from string to a byte array (ASCII or UTF-8,
> depending on your strings, getBytes() is platform dependent).
>
> http://developer.android.com/reference/java/security/MessageDigest.html
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home