yms/libotp.php
changeset 12 31387f4022e5
parent 0 9997bee9ad03
equal deleted inserted replaced
11:b9eb748ac1e4 12:31387f4022e5
    76   return $crc == 0;
    76   return $crc == 0;
    77 }
    77 }
    78 
    78 
    79 function yms_within($test, $control, $fuzz)
    79 function yms_within($test, $control, $fuzz)
    80 {
    80 {
    81   $min = $control - $fuzz;
    81   return abs($control - $test) <= $fuzz;
    82   $max = $control + $fuzz;
       
    83   return $test > $min && $test < $max;
       
    84 }
    82 }