Skip to content

Instantly share code, notes, and snippets.

@chx
Created February 27, 2019 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chx/50db023a4c300f99850b3fe78a135811 to your computer and use it in GitHub Desktop.
Save chx/50db023a4c300f99850b3fe78a135811 to your computer and use it in GitHub Desktop.
redirect rehash in mysql
REPLACE(REPLACE(REPLACE(
TO_BASE64(UNHEX(SHA2(CONCAT(:string1, LENGTH(language), :string2, language, :string3, LENGTH(redirect_source__path), :string4, redirect_source__path, :string5), 256))),
'+', '-'), '/', '_'), '=', '') AS hash_calc,
':string1' => 'a:2:{s:8:"language";s:',
':string2' => ':"',
':string3' => '";s:6:"source";s:',
':string4' => ':"',
':string5' => '";}',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment