Multiple hash algo SHA1 and SHA256 in 7.0

The guides explain a change in 7.0, from hashing with SHA1 to SHA256:

This does not appear to work: when creating a KeyGenerator in config/initializers, it does still use SHA1. Only later at runtime, when again creating a KeyGenerator, it does use SHA256. Obviousely those are not interoperable, and things do not work.

A specific usecase is devise Gem; at startup it creates KeyGenerator with SHA1.

As a workaround for now, I do issue this command in config/initializers:

ActiveSupport::KeyGenerator.hash_digest_class =

With that, my things do work again.

I am currently using version 7.0.1 - this is not the newest, but I didn’t see a notion in change log that it would have been fixed in the meantime.

Are you using turbo-rails? There was an issue prior to version 1.1.1 that would override Rails’ default and use SHA1. Before updating the gem, be mindful of this issue too: After updated to 1.1.1, ActionText attachments are not showing · Issue #340 · hotwired/turbo-rails · GitHub

$ grep turbo Gemfile*