1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel math sequences fry ;
6 : mod-nth ( n seq -- elt ) [ length mod ] [ nth ] bi ;
10 : xor-crypt ( seq key -- seq' )
11 [ empty-xor-key ] when-empty
12 [ dup length iota ] dip '[ _ mod-nth bitxor ] 2map ;