Airship\Engine\Security\Migration\WordPress::getHashWithMetadata PHP Method

getHashWithMetadata() public method

Use during imports to populate a table with metadata and a rehashed hash.
public getHashWithMetadata ( string $oldHash, EncryptionKey $passwordKey = null ) : array
$oldHash string
$passwordKey EncryptionKey
return array [HiddenString, array]
    public function getHashWithMetadata(string $oldHash, EncryptionKey $passwordKey = null) : array
    {
        if (!$passwordKey) {
            if (!$this->key instanceof EncryptionKey) {
                throw new \Exception(\__('No key was passed to this migration'));
            }
            $passwordKey = $this->key;
        }
        return [new HiddenString(Password::hash($oldHash, $passwordKey)), ['type' => self::TYPE, 'salt' => Binary::safeSubstr($oldHash, 0, 12)]];
    }