src/Robin/Ntlm/Hasher/LmHasher.php
public function hash(Password $password)
    {
        $string_password = substr($password->getValue(), 0, static::MAXIMUM_PASSWORD_LENGTH);
        $string_password = strtoupper($string_password);

        // Null-pad the string to the maximum length
        $string_password = str_pad($string_password, static::MAXIMUM_PASSWORD_LENGTH, static::NULL_PAD_CHARACTER);

        $halves = str_split($string_password, static::PASSWORD_SLICE_LENGTH);

        // Encrypt and concatenate each half
        $binary_hash = array_reduce(
            $halves,
            function ($result, $half) {
                return $result . $this->des_encrypter->encrypt(
                    $half,
                    static::ENCRYPT_DATA_CONSTANT,
                    CipherMode::ECB,
                    '' // DES-ECB expects a 0-byte-length initialization vector
                );
            },
            ''
        );

        return Hash::fromBinaryString($binary_hash, HashType::LM);
    }
public function hash(Password $password)
    {
        $string_password = substr($password->getValue(), 0, static::MAXIMUM_PASSWORD_LENGTH);
        $string_password = strtoupper($string_password);

        // Null-pad the string to the maximum length
        $string_password = str_pad($string_password, static::MAXIMUM_PASSWORD_LENGTH, static::NULL_PAD_CHARACTER);

        $halves = str_split($string_password, static::PASSWORD_SLICE_LENGTH);

        // Encrypt and concatenate each half
        $binary_hash = array_reduce(
            $halves,
            function ($result, $half) {
                return $result . $this->des_encrypter->encrypt(
                    $half,
                    static::ENCRYPT_DATA_CONSTANT,
                    CipherMode::ECB,
                    '' // DES-ECB expects a 0-byte-length initialization vector
                );
            },
            ''
        );

        return Hash::fromBinaryString($binary_hash, HashType::LM);
    }
{@inheritDoc}

NOTE: String operations are intentionally not "Unicode-aware", as the
LM Hash encryption algorithm is intended to operate on raw "bytes",
regardless of the byte-width of the character's encoding.