Handbook
Glossary
sqids-shuffle ( alphabet -- alphabet' )
Vocabulary
sqids
.
private
Inputs
alphabet
an
object
Outputs
alphabet'
an
object
Definition
USING:
kernel
math
sequences
;
IN:
sqids.private
::
sqids-shuffle
( alphabet -- alphabet' )
alphabet
clone
:>
chars chars
length
:>
len len 1
-
<iota>
[|
i |
len 1
-
i
-
:>
j i j
*
i chars
nth
+
j chars
nth
+
len
mod
:>
r i r chars
exchange
]
each
chars
;