Maybe you can assign function to a variable here and save one extra if statement later:

```
if RUBY_VERSION >= "1.9.3"
  require 'securerandom'
  securerandom_hex = SecureRandom.hex
else 
  require 'active_support/secure_random'
  securerandom_hex = ActiveSupport::SecureRandom.hex
end

...

securerandom_hex(80)
```

If it works...