You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
janet-hashids/test/consistent-shuffle.janet

26 lines
493 B

(import ../hashids :as h)
(assert
(= "abc" (h/consistent-shuffle "abc" "")))
(def salt "this is my salt")
(assert
(= "ba" (h/consistent-shuffle "ab" salt)))
(assert
(= "bca" (h/consistent-shuffle "abc" salt)))
(assert
(= "cadb" (h/consistent-shuffle "abcd" salt)))
(assert
(= "f17a8zvCwo0iuqYDXlJ4RmAS2end5ghTcpjbOWLK9GFyE6xUI3ZBMQtPsNHrkV"
(h/consistent-shuffle "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
"salt")))