From https://github.com/devwebcl/spring-samples
This simple sample to hash password using blowfish2a compatible with Postgres pgcrypto https://www.postgresql.org/docs/9.3/static/pgcrypto.html
It uses sample from http://docs.spring.io/spring-security/site/docs/current/apidocs/org/springframework/security/crypto/bcrypt/BCrypt.html