<?php

namespace Buckhill\Support;

/**
 * @param string $hash
 * @param int $length
 * @return string
 */
function rfc4226_truncate(string $hash, int $length): string
{
    return RFC4226Truncate::truncate($hash, $length);
}

/**
 * @param string $algo
 * @param string $secret
 * @param int $counter
 * @return string
 */
function hmac($algo = 'sha1', string $secret, int $counter): string
{
    return hash_hmac($algo, $secret, $counter, true);
}