     {
         let trimmed = value.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet());
         let hash = map(trimmed.unicodeScalars){ $0.value };
-        return self._decode(hash);
-    }
-    
-    func encode_hex()
-    {
-        
-    }
-    
-    func decode_hex()
-    {
-        
-    }
-    
-    func _encode(numbers:[Int]) -> [UInt32]
+        return self.decode(hash);
+    }
+    
+    func decode(value:[Char]) -> [Int]
+    {
+        return self._decode(value);
+    }
+    
+    private func _encode(numbers:[Int]) -> [Char]
     {
         var alphabet = self.alphabet;
         var numbers_hash_int = 0;

        
        let lottery = alphabet[numbers_hash_int % alphabet.count];
        var ret = [lottery];
        
        for (index, value) in enumerate(numbers)
        {
            let lsalt = ([lottery] + self.salt + alphabet)[0..<(alphabet.count)];
            shuffle(&alphabet, lsalt);
            let last = _hash(value, alphabet);
            ret += last;
            

            let excess = ret.count - half_length;
            if( excess > 0 )
            {
                let start = excess >> 1;
                ret = [Char](ret[start..<(start+half_length)])
            }
        }
        
        return ret;
    }
    
    private func _decode(hash:[Char]) -> [Int]
    {
        var ret = [Int]();
        
        var alphabet = self.alphabet;
        
        var hashes = split(hash, { contains(self.guards, $0) }, maxSplit: hash.count, allowEmptySlices: true);
        let hashesCount = hashes.count, i = ((hashesCount == 2) || (hashesCount == 3)) ? 1 : 0;
        let hash = hashes[i];
        
        if(hash.count > 0)
        {
            let lottery = hash[0];
            let valuesHashes = hash[1..<hash.count];
            let valueHashes = split(valuesHashes, { contains(self.seps, $0) }, maxSplit: valuesHashes.count, allowEmptySlices: true);

            var lsalt = [Char]();
            let (lsaltARange, lsaltRange) = _saltify(&lsalt, lottery, alphabet);

            for subHash in valueHashes
            {
                shuffle(&alphabet, lsalt, lsaltRange);
                ret.append(self._unhash(subHash, alphabet));
                lsalt.replaceRange(lsaltARange, with: alphabet);
            }
        }
        
        return ret;
    }
    
    private func _hash(var number:Int, _ alphabet:[Char]) -> [Char]
    {
        var hash = [Char]();
        let length = alphabet.count
        
        do {
