src/Core.php
/**
     * Sign some data. If we get this data back again, we will know that it came from us
     * untampered (as long as the signature still matches). This is useful for things like
     * tokens sent in emails allowing them to perform actions without having to sign in
     * @param array $data - the data we wish to sign.
     * @return string - the generated signature for the provided data.
     */
Sign some data. If we get this data back again, we will know that it came from us
untampered (as long as the signature still matches). This is useful for things like
tokens sent in emails allowing them to perform actions without having to sign in
@param array $data - the data we wish to sign.
@return string - the generated signature for the provided data.
Sign some data . If we get this data back again we will know that it came from us untampered ( as long as the signature still matches ) . This is useful for things like tokens sent in emails allowing them to perform actions without having to sign in @param array $data - the data we wish to sign . @return string - the generated signature for the provided data .
public static function generateSignature(array $data, string $secret)
    {
        ksort($data);
        $stringForm = json_encode($data);
        return hash_hmac("sha256", $stringForm, $secret);
    }
public static function generateSignature ( array $ data , string $ secret ) { ksort ( $ data ) ; $ stringForm = json_encode ( $ data ) ; return hash_hmac ( " sha256 " , $ stringForm , $ secret ) ; }
Sign some data.
Sign some data .