Ritesh
Ritesh

Reputation: 23

Equivalent encryption logic in MySQL

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);

Upvotes: 2

Views: 73

Answers (1)

ysth
ysth

Reputation: 98508

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

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

Upvotes: 1

Related Questions