Created
October 3, 2012 23:18
-
-
Save cprice404/3830511 to your computer and use it in GitHub Desktop.
awesome set magic
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
1.8.7 :004 > def testfoo(ports) | |
1.8.7 :005?> val1 = Zlib.crc32(Set.new(ports).inspect) | |
1.8.7 :006?> val2 = Zlib.crc32(Set.new(Set.new(ports)).inspect) | |
1.8.7 :007?> puts "val1 '#{val1}'" | |
1.8.7 :008?> puts "val2 '#{val2}'" | |
1.8.7 :009?> end | |
=> nil | |
1.8.7 :010 > testfoo([22,8080]) | |
val1 '3915886963' | |
val2 '3915886963' | |
=> nil | |
1.8.7 :011 > testfoo([22,8140]) | |
val1 '2614511658' | |
val2 '2664507259' | |
=> nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment