getPasswordHash static method

int getPasswordHash(
  1. String password
)

Returns hash value for the password string.

Implementation

static int getPasswordHash(String password) {
  if (password == '') {
    return 0;
  }
  int usHash = 0;
  // ignore: prefer_final_locals
  for (int iCharIndex = 0, len = password.length;
      iCharIndex < len;
      iCharIndex++) {
    List<bool> bits = _getCharBits15(password[iCharIndex]);
    bits = _rotateBits(bits, iCharIndex + 1);
    final int curNumber = _getUInt16FromBits(bits);
    usHash ^= curNumber;
  }
  return usHash ^ password.length ^ _defPasswordConst;
}