java - SHA 256 for android app -


this question has answer here:

i have in php method call security web service:

// token generator; date utc/gmt $tokennewinputdata = date("y-m-d"); $tokennew = hash_hmac('sha256', $tokennewinputdata, key); echo ‘token: ‘.$tokennew; 

where key it's "password" text.

i must use same method android app generate security code in same way , add string call.

can me please example traslate php code android code? thanks.

write down below code.

messagedigest md = messagedigest.getinstance("sha-256"); string text = "this text"; md.update(text.getbytes("utf-8")); // change "utf-16" if needed byte[] digest = md.digest(); 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -