Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
['+45 33 13 44 11', 'DK', null, Big('0.25'), 'DK', null],
['+372 644 3484', 'EE', null, Big('0.20'), 'EE', null],
['+34 922 21 47 43', 'ES', 'Canary Islands', Big('0.0'), 'ES', 'Canary Islands'],
['+34 952 68 63 80', 'ES', 'Melilla', Big('0.0'), 'ES', 'Melilla'],
['+34 952 52 95 20', 'ES', null, Big('0.21'), 'ES', null],
['+34 956 50 19 36', 'ES', 'Ceuta', Big('0.0'), 'ES', 'Ceuta'],
['+34 956 02 50 00', 'ES', null, Big('0.21'), 'ES', null],
['+34 913 55 08 73', 'ES', null, Big('0.21'), 'ES', null],
['+358 20 7590317', 'FI', null, Big('0.24'), 'FI', null],
['+33 1 40 46 79 00', 'FR', null, Big('0.20'), 'FR', null],
['+44 20 7229 8331', 'GB', null, Big('0.20'), 'GB', null],
['+30 2377 023643', 'GR', 'Mount Athos', Big('0.0'), 'GR', 'Mount Athos'],
['+30 2377 071189', 'GR', null, Big('0.23'), 'GR', null],
['+30 21 3214 4890', 'GR', null, Big('0.23'), 'GR', null],
['+385 1 4564 111', 'HR', null, Big('0.25'), 'HR', null],
['+36 1 263 6000', 'HU', null, Big('0.27'), 'HU', null],
['+353 1 475 8555', 'IE', null, Big('0.23'), 'IE', null],
// Campione only has phone access through Switzerland
['+41 91 649 75 41', 'IT', "Campione d'Italia", Big('0.0'), 'IT', "Campione d'Italia"],
['+41 91 640 16 16', 'CH', null, Big('0.0'), 'CH', null],
['+39 0342 996002', 'IT', 'Livigno', Big('0.0'), 'IT', 'Livigno'],
['+39 0342 528111', 'IT', null, Big('0.22'), 'IT', null],
['+39 06 49971', 'IT', null, Big('0.22'), 'IT', null],
['+370 5 231 4930', 'LT', null, Big('0.21'), 'LT', null],
['+352 22 28 09', 'LU', null, Big('0.15'), 'LU', null],
['+371 26 448 632', 'LV', null, Big('0.21'), 'LV', null],
['+356 2122 0536', 'MT', null, Big('0.18'), 'MT', null],
['DK', 'Capital Region', 'Copenhagen', 'DK', null, Big('0.25'), 'DK', null],
['EE', 'Harju', 'Tallinn', 'EE', null, Big('0.20'), 'EE', null],
['ES', 'Canary Islands', 'Santa Cruz de Tenerife', 'ES', 'Canary Islands', Big('0.0'), 'ES', 'Canary Islands'],
['ES', 'Melilla', 'Melilla', 'ES', 'Melilla', Big('0.0'), 'ES', 'Melilla'],
['ES', 'Ceuta', 'Ceuta', 'ES', 'Ceuta', Big('0.0'), 'ES', 'Ceuta'],
['ES', 'Madrid', 'Madrid', 'ES', null, Big('0.21'), 'ES', null],
['FI', '', 'Helsinki', 'FI', null, Big('0.24'), 'FI', null],
['FR', 'Île-de-France', 'Paris', 'FR', null, Big('0.20'), 'FR', null],
['GB', 'England', 'London', 'GB', null, Big('0.20'), 'GB', null],
['GR', 'Central Macedonia', 'Ormylia', 'GR', 'Mount Athos', Big('0.0'), 'GR', 'Mount Athos'],
['GR', 'Central Macedonia', 'Ormylia', 'GR', null, Big('0.23'), 'GR', null],
['GR', 'Attica', 'Athens', 'GR', null, Big('0.23'), 'GR', null],
['HR', 'Grad Zagreb', 'Zagreb', 'HR', null, Big('0.25'), 'HR', null],
['HU', 'Budapest fovaros', 'Budapest', 'HU', null, Big('0.27'), 'HU', null],
['IE', 'Leinster', 'Dublin', 'IE', null, Big('0.23'), 'IE', null],
['IT', 'Lombardy', 'Como', 'IT', "Campione d'Italia", Big('0.0'), 'IT', "Campione d'Italia"],
['IT', 'Lombardy', 'Como', 'IT', null, Big('0.22'), 'IT', null],
['IT', 'Lombardy', 'Livigno', 'IT', 'Livigno', Big('0.0'), 'IT', 'Livigno'],
// Test an exception geoip2 record with a non-exception address
['IT', 'Lombardy', 'Livigno', 'IT', null, Big('0.0'), 'IT', 'Livigno'],
['IT', 'Lombardy', 'Cologne', 'IT', null, Big('0.22'), 'IT', null],
['LT', 'Vilnius County', 'Vilnius', 'LT', null, Big('0.21'), 'LT', null],
['LU', 'District de Luxembourg', 'Luxembourg', 'LU', null, Big('0.15'), 'LU', null],
['LV', 'Riga', 'Riga', 'LV', null, Big('0.21'), 'LV', null],
addMessage( seq, time, shouldExecute=true, priority=0 ) {
if( typeof time === 'number' ) time = Big( time )
// TODO: should 4 be a function of the time signature?
time = time.times( 4 ).plus( this.currentTime )
this.queue.push({ seq, time, shouldExecute, priority })
},
exports = module.exports = functions.https.onRequest((req, res) => {
// Example of using a npm package only in Firebase Functions.
const thisDoesNothing = Big(123);
const time = new Date().getTime();
let winner = { time };
if (time & 1) { // Timestamp is odd.
winner.name = 'blue';
} else { // Timestamp is even.
winner.name = 'red';
}
res.send(winner);
});
static weiToEtherString(wei: any): string {
if (!isEthAvailable) {
throw new EthereumLibraryUnavailableError(ethImport);
}
let bn = wei;
if (!(wei instanceof ethUtil.BN)) {
bn = new ethUtil.BN(wei);
}
Big.E_POS = 256;
Big.E_NEG = -18;
const weiString = bn.toString(10);
const big = new Big(weiString);
// 10^18
const ether = big.div('1000000000000000000');
return ether.toPrecision();
}
Util.weiToEtherString = function(wei) {
let bn = wei;
if (!(wei instanceof ethUtil.BN)) {
bn = new ethUtil.BN(wei);
}
Big.E_POS = 256;
Big.E_NEG = -18;
const weiString = bn.toString(10);
const big = new Big(weiString);
// 10^18
const ether = big.div('1000000000000000000');
return ether.toPrecision();
};
['DE', 'Heligoland', Big('0.0'), 'DE', 'Heligoland'],
['DE', 'Büsingen am Hochrhein', Big('0.0'), 'DE', 'Büsingen am Hochrhein'],
['DE', null, Big('0.19'), 'DE', null],
['DK', null, Big('0.25'), 'DK', null],
['EE', null, Big('0.20'), 'EE', null],
['ES', 'Canary Islands', Big('0.0'), 'ES', 'Canary Islands'],
['ES', 'Melilla', Big('0.0'), 'ES', 'Melilla'],
['ES', 'Ceuta', Big('0.0'), 'ES', 'Ceuta'],
['ES', null, Big('0.21'), 'ES', null],
['FI', null, Big('0.24'), 'FI', null],
['FR', null, Big('0.20'), 'FR', null],
['GB', 'Akrotiri', Big('0.19'), 'CY', null],
['GB', 'Dhekelia', Big('0.19'), 'CY', null],
['GB', null, Big('0.20'), 'GB', null],
['GR', 'Mount Athos', Big('0.0'), 'GR', 'Mount Athos'],
['GR', null, Big('0.23'), 'GR', null],
['HR', null, Big('0.25'), 'HR', null],
['HU', null, Big('0.27'), 'HU', null],
['IE', null, Big('0.23'), 'IE', null],
['IT', "Campione d'Italia", Big('0.0'), 'IT', "Campione d'Italia"],
['IT', 'Livigno', Big('0.0'), 'IT', 'Livigno'],
['IT', null, Big('0.22'), 'IT', null],
['LT', null, Big('0.21'), 'LT', null],
['LU', null, Big('0.15'), 'LU', null],
['LV', null, Big('0.21'), 'LV', null],
['MT', null, Big('0.18'), 'MT', null],
['NL', null, Big('0.21'), 'NL', null],
['PL', null, Big('0.23'), 'PL', null],
['PT', 'Azores', Big('0.0'), 'PT', 'Azores'],
['PT', 'Madeira', Big('0.0'), 'PT', 'Madeira'],
['PT', null, Big('0.23'), 'PT', null],
['RO', null, Big('0.24'), 'RO', null],
['ES', '35500', 'Arrecife', Big('0.0'), 'ES', 'Canary Islands'],
['ES', '38700', 'Santa Cruz de La Palma', Big('0.0'), 'ES', 'Canary Islands'],
['ES', '38880', 'San Sebastián de La Gomera', Big('0.0'), 'ES', 'Canary Islands'],
['ES', '38900', 'Valverde', Big('0.0'), 'ES', 'Canary Islands'],
['ES', '35540', 'Caleta de Sebo', Big('0.0'), 'ES', 'Canary Islands'],
['ES', '35530', 'Teguise', Big('0.0'), 'ES', 'Canary Islands'],
['ES', '52002', 'Melilla', Big('0.0'), 'ES', 'Melilla'],
['ES', '51001', 'Ceuta', Big('0.0'), 'ES', 'Ceuta'],
['es', '28001', 'Mardrid', Big('0.21'), 'ES', null],
['FI', '00140', 'Helsinki', Big('0.24'), 'FI', null],
['FR', '75016', 'Paris', Big('0.20'), 'FR', null],
['GB', 'BFP O57', 'Akrotiri', Big('0.19'), 'CY', null],
['GB', 'BFP O58', 'Dhekelia', Big('0.19'), 'CY', null],
['GB', 'W8 4RU', 'London', Big('0.20'), 'GB', null],
['GR', '63086', 'Mount Athos', Big('0.0'), 'GR', 'Mount Athos'],
['GR', '10001', 'Athens', Big('0.23'), 'GR', null],
['HR', 'HR-10000', 'Zagreb', Big('0.25'), 'HR', null],
['HU', '1239', 'Budapest', Big('0.27'), 'HU', null],
['IE', 'Dublin 1', 'Dublin', Big('0.23'), 'IE', null],
['IE', null, 'Galway', Big('0.23'), 'IE', null],
['it', '22060', "Campione d'Italia", Big('0.0'), 'IT', "Campione d'Italia"],
['IT', '22060', 'Campione dItalia', Big('0.0'), 'IT', "Campione d'Italia"],
['it ', '22060', 'Campione', Big('0.0'), 'IT', "Campione d'Italia"],
['it', '23030', 'Livigno', Big('0.0'), 'IT', 'Livigno'],
['IT', '00100', 'Rome', Big('0.22'), 'IT', null],
['LT', '01001', 'Vilnius', Big('0.21'), 'LT', null],
['LU', 'L-1248', 'Luxembourg', Big('0.15'), 'LU', null],
['LV', 'LV-1001', 'Riga', Big('0.21'), 'LV', null],
['MT', 'VLT', 'Valletta', Big('0.18'), 'MT', null],
['NL', '1000', 'Amsterdam', Big('0.21'), 'NL', null],
['PL', '00-001', 'Warsaw', Big('0.23'), 'PL', null],
['PT', '9970', 'Santa Cruz das Flores', Big('0.0'), 'PT', 'Azores'],
function getBits(buffer, from, length) {
let ret = new Big(0);
for (let ptr = from; ptr < from + length; ptr++) {
ret = ret.times(2);
if (getBit(buffer, ptr)) {
ret = ret.plus(1);
}
}
return ret;
}
decode: function(base62String) {
base62String = base62String.toString();
var result = Big(0), big62 = Big(62),
characters = base62String.split('').reverse();
characters.forEach(function(character, index) {
result = result.plus(big62.pow(index).times(characterSet.indexOf(character)));
});
return result.toFixed();
},
encodeHex: function(hexString) {