Guest User

Untitled

a guest
Apr 22nd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. ~> ruby -v
  2. ruby 1.8.7 (2008-06-20 patchlevel 22) [i686-darwin9.5.1]
  3. ~> file `which ruby`
  4. /www/bin/ruby: Mach-O 64-bit executable x86_64
  5. ~> irb
  6.  
  7. >> hex = "65ce30a0bf3cc5b026ca66e884d53c69"
  8. => "65ce30a0bf3cc5b026ca66e884d53c69"
  9. >> hex[0..13].to_i(16)
  10. => 28655680898415813
  11. >> hex[0..14].to_i(16)
  12. => 458490894374653019
  13. >> hex[0..15].to_i(16)
  14. => 3208431024
  15. # WTF?!!!
  16.  
  17. ~> ruby -v
  18. ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0]
  19. ~> file `which ruby`
  20. /www/bin/ruby: Mach-O 64-bit executable x86_64
  21. ~> irb
  22. irb(main):001:0> hex = "65ce30a0bf3cc5b026ca66e884d53c69"
  23. => "65ce30a0bf3cc5b026ca66e884d53c69"
  24. irb(main):002:0> hex[0..13].to_i(16)
  25. => 28655680898415813
  26. irb(main):003:0> hex[0..14].to_i(16)
  27. => 458490894374653019
  28. irb(main):004:0> hex[0..15].to_i(16)
  29. => 7335854309994448304
Add Comment
Please, Sign In to add comment