def generate_secret
      if defined?(SecureRandom)
        SecureRandom.urlsafe_base64(32)
      else
        Base64.encode64(
          Digest::SHA256.digest("#{Time.now}-#{Time.now.usec}-#{$$}-#{rand}")
        ).gsub('/','-').gsub('+','_').gsub('=','').strip
      end
    end
def generate_secret
      if defined?(SecureRandom)
        SecureRandom.urlsafe_base64(32)
      else
        Base64.encode64(
          Digest::SHA256.digest("#{Time.now}-#{Time.now.usec}-#{$$}-#{rand}")
        ).gsub('/','-').gsub('+','_').gsub('=','').strip
      end
    end
Generate a unique cryptographically secure secret