summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/math/hexdec.js
blob: 50026acd6e5daf704e159170272a5ef737b250b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
'use strict';

module.exports = function hexdec(hexString) {
  //  discuss at: http://locutus.io/php/hexdec/
  // original by: Philippe Baumann
  //   example 1: hexdec('that')
  //   returns 1: 10
  //   example 2: hexdec('a0')
  //   returns 2: 160

  hexString = (hexString + '').replace(/[^a-f0-9]/gi, '');
  return parseInt(hexString, 16);
};
//# sourceMappingURL=hexdec.js.map