Last active
February 2, 2017 11:39
-
-
Save iberianpig/37e9054811e6ab3d7f5fbdc7e80c25bb to your computer and use it in GitHub Desktop.
文字列を与えると一様な組み合わせを返す
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
['a', 'b', 'c', 'd'].permutation.to_a[Digest::MD5.hexdigest("hogefuga").to_i(16) % 24] | |
#=> ["a", "b", "d", "c"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment