How to use apache-md5 - 1 common examples

To help you get started, we’ve selected a few apache-md5 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github verdaccio / verdaccio-htpasswd / src / utils.ts View on Github external
export function verifyPassword(passwd: string, hash: string): boolean {
  if (hash.match(/^\$2(a|b|y)\$/)) {
    return bcrypt.compareSync(passwd, hash);
  } else if (hash.indexOf('{PLAIN}') === 0) {
    return passwd === hash.substr(7);
  } else if (hash.indexOf('{SHA}') === 0) {
    return (
        .update(passwd, 'utf8')
        .digest('base64') === hash.substr(5)
  // for backwards compatibility, first check md5 then check crypt3
  return md5(passwd, hash) === hash || crypt3(passwd, hash) === hash;


Node.js module for Apache style password encryption using md5.

Latest version published 8 months ago

Package Health Score

67 / 100
Full package analysis

Popular apache-md5 functions

Popular JavaScript code snippets

Find secure code to use in your application or website