Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
//The Crypto class can be found in the as3crypto library
//the library can be found at: http://code.google.com/p/as3crypto/
var password:String = "12345";
var c:Crypto = new Crypto();
var cipher:IHash = Crypto.getHash( "sha256" );
var data:ByteArray = Hex.toArray( Hex.fromString( password ) );
var hashed:String = Base64.encodeByteArray( cipher.hash( data ) );
Alert.show( hashed ); |