docs: def scrypt_mcf(password, salt=None, N=SCRYPT_N, r=SCRYPT_r, p=SCRYPT_p,
                 prefix=SCRYPT_MCF_PREFIX_DEFAULT):
      """Derives a Modular Crypt Format hash using the scrypt KDF
  
      Parameter space is smaller than for scrypt():
      N must be a power of two larger than 1 but no larger than 2 ** 31
      r and p must be positive numbers between 1 and 255
      Salt must be a byte string 1-16 bytes long.
  
      If no salt is given, a random salt of 128+ bits is used. (Recommended.)
      """
      if (prefix != SCRYPT_MCF_PREFIX_s1 and prefix != SCRYPT_MCF_PREFIX_ANY):
          return mcf_mod.scrypt_mcf(scrypt, password, salt, N, r, p, prefix)
      if isinstance(password, unicode):
          password = password.encode('utf8')
      elif not isinstance(password, bytes):
          raise TypeError('password must be a unicode or byte string')
      if salt is None:
          salt = os.urandom(16)
      elif not (1 <= len(salt) <= 16):
          raise ValueError('salt must be 1-16 bytes')
      if N > 2**31:
          raise ValueError('N > 2**31 not supported')
      if b'\0' in password:
          raise ValueError('scrypt_mcf password must not contain zero bytes')
  
      hash = scrypt(password, salt, N, r, p)
  
      h64 = base64.b64encode(hash)
      s64 = base64.b64encode(salt)
  
      out = ctypes.create_string_buffer(125)
      ret = _libscrypt_mcf(N, r, p, s64, h64, out)
      if not ret:
          raise ValueError
  
      out = out.raw.strip(b'\0')
      # XXX: Hack to support old libscrypt (like in Ubuntu 14.04)
      if len(out) == 123:
          out = out + b'='
  
      return out