Skip to content

Instantly share code, notes, and snippets.

@iberianpig
Last active February 2, 2017 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iberianpig/37e9054811e6ab3d7f5fbdc7e80c25bb to your computer and use it in GitHub Desktop.
Save iberianpig/37e9054811e6ab3d7f5fbdc7e80c25bb to your computer and use it in GitHub Desktop.
文字列を与えると一様な組み合わせを返す
['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