Revisions

gist: 226339 Download_button fork
public
Public Clone URL: git://gist.github.com/226339.git
Embed All Files: show embed
GG x86_64 ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 ~> ruby -v
ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-darwin9.5.1]
 ~> file `which ruby`
/www/bin/ruby: Mach-O 64-bit executable x86_64
 ~> irb
 
>> hex = "65ce30a0bf3cc5b026ca66e884d53c69"
=> "65ce30a0bf3cc5b026ca66e884d53c69"
>> hex[0..13].to_i(16)
=> 28655680898415813
>> hex[0..14].to_i(16)
=> 458490894374653019
>> hex[0..15].to_i(16)
=> 3208431024
# WTF?!!!
 
 ~> ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0]
 ~> file `which ruby`
/www/bin/ruby: Mach-O 64-bit executable x86_64
 ~> irb
irb(main):001:0> hex = "65ce30a0bf3cc5b026ca66e884d53c69"
=> "65ce30a0bf3cc5b026ca66e884d53c69"
irb(main):002:0> hex[0..13].to_i(16)
=> 28655680898415813
irb(main):003:0> hex[0..14].to_i(16)
=> 458490894374653019
irb(main):004:0> hex[0..15].to_i(16)
=> 7335854309994448304