code: function hash(method) {
    // Is user supplies a function, use it and assume they will take of any
    // encoding (Base-64 or otherwise).
    if (typeof method === 'function') {
      return method;
    }
  
    if (hashFunctions.hasOwnProperty(method)) {
      return hashFunctions[method];
    }
  
    throw new Error(`Could not resolve hash function, received ${typeof method}.`);
  }
docs: Return a hash function for SGP to use.