title: How to Make Custom HashPassword function in Feathersjs Authentication
body: <p>I notice in feathersjs documentation </p>
  
  <blockquote>
    <p>hashPassword This hook is used to hash plain text passwords before
    they are saved to the database. It uses the bcrypt algorithm by
    default but can be customized by passing your own options.hash
    function.</p>
  </blockquote>
  
  <p>How do I apply this custom function in feathers js hook, hashPassword hook?</p>
  
  <pre><code>const { authenticate } = require('@feathersjs/authentication').hooks;
  
  const {
    hashPassword, protect
  } = require('@feathersjs/authentication-local').hooks;
  
  
  module.exports = {
    before: {
      all: [],
      find: [ authenticate('jwt') ],
      get: [ authenticate('jwt') ],
      create: [ hashPassword() ],
      update: [ hashPassword(),  authenticate('jwt') ],
      patch: [ hashPassword(),  authenticate('jwt') ],
      remove: [ authenticate('jwt') ]
    },
  
    after: {
      all: [ 
        // Make sure the password field is never sent to the client
        // Always must be the last hook
        protect('password')
      ],
      find: [],
      get: [],
      create: [],
      update: [],
      patch: [],
      remove: []
    },
  
    error: {
      all: [],
      find: [],
      get: [],
      create: [],
      update: [],
      patch: [],
      remove: []
    }
  };
  </code></pre>
  
  <p>Does anyone have the answer? </p>
  
  <p>Thanks </p>