math.js 395 B

1234567891011121314151617
  1. /*
  2. * Copyright 2018 Scytl Secure Electronic Voting SA
  3. *
  4. * All rights reserved
  5. *
  6. * See our extended copyright notice in *file 'Copyright.txt' which is part of this source code package
  7. */
  8. /* jshint node:true */
  9. 'use strict';
  10. var MIN_MATH_ROUND_ENTROPY_FACTOR = 1000000;
  11. module.exports = {
  12. entropyRound: function(data) {
  13. return Math.round(data * MIN_MATH_ROUND_ENTROPY_FACTOR);
  14. }
  15. };