Skip to content

Instantly share code, notes, and snippets.

View mathiasaerts's full-sized avatar

Mathias Aerts mathiasaerts

View GitHub Profile
@malc0mn
malc0mn / solrPassHasher.php
Last active December 17, 2021 09:37
Quick and dirty, but mostly convenient, Apache Solr password hash generator in PHP (5.4+).
<?php
/**
* Function to generate a salted password hash to be used in a 'security.json'
* file to secure Apache Solr.
* This is the core function that you can extract for use in your own code.
*
* @see https://lucene.apache.org/solr/guide/basic-authentication-plugin.html#enable-basic-authentication
*
* @param string $pw The password to hash