Digest::QuickXor - The QuickXorHash
use Digest::QuickXor;
my $qx = Digest::QuickXor->new;
$qx->add(@data);
$qx->b64digest;
$qx->addfile($filehandle);
$qx->b64digest;
$qx->add($wrong_data);
$qx->reset;
$qx->add($correct_data);
# use as function
use Digest::QuickXor 'quickxorhash';
my $hash = quickxorhash(@data);
Digest::QuickXor implements the QuickXorHash.
The QuickXorHash is the digest used by Microsoft on Office 365 OneDrive for Business and Sharepoint. It was published by Microsoft in 2016 in form of a C# script. The explanation describes it as a "quick, simple non-cryptographic hash algorithm that works by XORing the bytes in a circular-shifting fashion".
None of the functions is exported by default.
use Digest::QuickXor 'quickxorhash';
my $hash = quickxorhash(@data);
Returns the digest for the provided data.
$qx = Digest::QuickXor->new;
$qx = $qx->add($data);
$qx = $qx->add(@data);
Adds new blocks of data.
$qx = $qx->addfile($filehandle);
Adds data from a file handle.
$string = $qx->b64digest;
Returns the digest and resets the object.
$qx = $qx->reset;
Resets the object so it is ready to accept new data.
© 2019 by Tekki (Rolf Stöckli).
© for the original algorithm 2016 by Microsoft.
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.
Explanation of the QuickXorHash Algorithm in the OneDrive Dev Center.
QuickXorHash.cs by Ryan Gregg.
quickxor-c, C implementation of the hash, base code for this module.