Issue #6799 has been updated by tenderlovemaking (Aaron Patterson). File secure_random.patch added Could we do this for SecureRandom.hex as well? I've attached a patch. /cc akr ---------------------------------------- Bug #6799: Digest::*.hexdigest returns an ASCII-8BIT String https://bugs.ruby-lang.org/issues/6799#change-29198 Author: Eregon (Benoit Daloze) Status: Closed Priority: Normal Assignee: Eregon (Benoit Daloze) Category: ext Target version: 2.0.0 ruby -v: ruby 2.0.0dev (2012-07-15 trunk 36395) [x86_64-darwin10.8.0] $ ruby -rdigest/sha1 -e 'p Digest::SHA1.hexdigest("a").encoding' #<Encoding:ASCII-8BIT> I'm happy to provide a patch. -- http://bugs.ruby-lang.org/