1  /**
     2   * com.sekati.crypt.Goauld
     3   * @version 1.0.1
     4   * @author jason m horwitz | sekati.com
     5   * Copyright (C) 2007  jason m horwitz, Sekat LLC. All Rights Reserved.
     6   * Released under the MIT License: http://www.opensource.org/licenses/mit-license.php
     7   * 
     8   * Sourced from ascrypt for dependencies only - version 2.0, author Mika Pamu
     9   */
    10  
    11  import com.sekati.crypt.ICipher;
    12  
    13  /**
    14   * Encodes and decodes a Goauld string.
    15   */
    16  class com.sekati.crypt.Goauld implements ICipher {
    17  
    18  	public static var shiftValue:Number = 6;
    19  
    20  	/**
    21  	 * Encodes and decodes a Goauld string with the character code shift value.
    22  	 * @param src (String)
    23  	 * @return String  
    24  	 */
    25  	public static function calculate(src:String):String {
    26  		var result:String = new String( "" );
    27  		for (var i:Number = 0; i < src.length ; i++) {
    28  			var charCode:Number = src.substr( i, 1 ).charCodeAt( 0 );
    29  			result += String.fromCharCode( charCode ^ shiftValue );
    30  		}
    31  		return result;
    32  	}
    33  
    34  	private function Goauld() {
    35  	}
    36  }