matethurzo/liferay-portal — pull request #864 by xinsuizhao (2014-11-18 19:08:26+00:00)
Title: Lps 51488

Hi @matethurzo,

this is a tentative pull request to get feedback from you on how to solve the issue better.

currently I am using PasswordEncryptorUtil.encrypt() method with SHA encryption, this will give us the same output for the same input and the result has a fixed length. As for the ''/", I simply replaced it with "." Some issues I want to discuss with you are:
1. is there a better way to apply the hashing function?
2. is there a better way to handle "/" in the result?
3. I was trying to wrap the logic to a method in StringUtil class but failed to do so, because the PasswordEncryptorUtil class couldn't be imported.
4. should we do a length check for the portlet id so that we only apply hashing to those that exceed the size limit?

currently the master has some issue on importing that any portlet import would fail, so I was not able to verify my fix yet. but from last week's test, this fix should prevent the Truncation Error from happening

let me know if you have any question, thank you for your help