Paste: `garden fence encryption algorithm' - quick and dirty

Author: prunedtree
Mode: factor
Date: Sat, 14 Mar 2009 20:53:10
Plain Text |
: invert ( perm -- perm' ) <enum> >alist sort-values keys ;
: v-perm ( n -- perm ) [1,b] dup <reversed> rest append but-last ;
: full-perm ( seq n -- perm ) [ length dup ] [ v-perm ] bi* <repetition> concat swap head ;
: v-enc ( seq n -- seq' ) over [ full-perm invert ] dip nths >string ;

New Annotation

Summary:
Author:
Mode:
Body: