Equivalent encryption logic in MySQL

Viewed 63

enter image description here

What will be equivalent encryption logic in MySQL ? Using something like following is not yielding require result.

select sha2('Tpostest123',256);

1 Answers

SHA2 returns a hexidecimal string value; you want it in base64 form instead. For that, do:

select to_base64(unhex(sha2('Tpostest123',256)));
Related