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


class Hashids
{
    private let MIN_ALPHABET_LENGTH:Int = 16;
    
    private let SEP_DIV:Double = 3.5;

        return Int(trunc(value));
    }
    
    private func _saltify(inout salt:[Char], _ lottery:Char, _ alphabet:[Char]) -> (Range<Int>, Range<Int>)
    {
        salt.append(lottery);
        salt = salt + self.salt;
        salt = salt + alphabet;
        let lsaltARange = (self.salt.count + 1)..<salt.count;
        let lsaltRange = 0..<alphabet.count;
        return (lsaltARange, lsaltRange);
    }
   
}

internal func contains<T:CollectionType where T.Generator.Element:Equatable>(a:T, e:T.Generator.Element) -> Bool
