Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

116
Views
Script de contenido de extensión de Chrome para extraer funciones de URL

Este es solo un fragmento de código para crear una extensión de Chrome para detectar la URL de phishing. El siguiente código es para extraer las características de la URL. Lo que no entiendo es el propósito de la function predict(data,weight) . ¿Para qué sirven los números en peso? Ej: weight = [3.33346292e-01, ...]

 var testdata; var prediction; function predict(data,weight){ var f = 0; weight = [3.33346292e-01,-1.11200396e-01,-7.77821806e-01,1.11058590e-01,3.89430647e-01,1.99992062e+00,4.44366975e-01,-2.77951957e-01,-6.00531647e-05,3.33200243e-01,2.66644002e+00,6.66735991e-01,5.55496098e-01,5.57022408e-02,2.22225591e-01,-1.66678858e-01]; for(var j=0;j<data.length;j++) { f += data[j] * weight[j]; } return f > 0 ? 1 : -1; } function isLongURL(){ var url = window.location.href; if(url.length<54){ console.log("NP"); return -1; } else if(url.length>=54 && url.length<=75){ console.log("Maybe"); return 0; } else{ console.log("P"); return 1; } } testdata = [isLongURL(),isTinyURL(),isAlphaNumericURL(),isRedirectingURL(),isHypenURL()]; prediction = predict(testdata); chrome.extension.sendRequest(prediction);

Hay muchos otros códigos de función de características de URL, pero aquí solo incluí un ejemplo que es la verificación de URL larga.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!