class JWT::Decode

def sort_by_alg_header(algs)

Move algorithms matching the JWT alg header to the beginning of the list
def sort_by_alg_header(algs)
  return algs if algs.size <= 1
  algs.partition { |alg| alg.valid_alg?(alg_in_header) }.flatten
end