Miłosz Osiński
Jul 10, 2017 · 1 min read

Hi,
It’s strange that so far nobody has reported here any problems with storing and reading bytes string in environment variables.
In article You used figaro I tested it and dotenv-rails too, unfortunately in both cases with the same result..

Solution:

# result saved in .env filesalt.unpack('H*').first
key.unpack('H*').first
# read values from .env file[ENV['SALT']].pack('H*')
[ENV['KEY']].pack('H*')

Regards!

    Miłosz Osiński

    Written by

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade