So I found this code on LoginController.java
Code: Select all
MessageDigest md = MessageDigest.getInstance("SHA"); byte[] raw = password.getBytes("UTF-8"); byte[] hash = md.digest(raw);
I made this code for actionscript 3
Code: Select all
Login_Usuario.Texto_Usuario.text = encodeUTF8 (Login_Usuario.Texto_Usuario.text); Login_Usuario.Texto_Usuario.text = SHA1.hash (Login_Usuario.Texto_Usuario.text); Login_Usuario.Texto_Usuario.text = Base64.encode(Login_Usuario.Texto_Usuario.text);
Code: Select all
function encodeUTF8 (text:String):String { var a:uint, n:uint, A:uint; var utf:String; utf = ""; A = text.length; for (a = 0; a < A; a++) { n = text.charCodeAt (a); if (n < 128) { utf += String.fromCharCode (n); } else if ((n > 127) && (n < 2048)) { utf += String.fromCharCode ((n >> 6) | 192); utf += String.fromCharCode ((n & 63) | 128); } else { utf += String.fromCharCode ((n >> 12) | 224); utf += String.fromCharCode (((n >> 6) & 63) | 128); utf += String.fromCharCode ((n & 63) | 128); } } return utf;}
Thx a lot