npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cardtestlib

v0.0.1

Published

Poderosa y versátil librería de JS diseñada para generar números de tarjetas de crédito válidos para propósitos de prueba. Ideal para desarrolladores que necesitan simular transacciones, validar sistemas de pago, o realizar pruebas de integración, CardTes

Downloads

11

Readme

CardTestLib

Poderosa y versátil librería de JS diseñada para generar números de tarjetas de crédito válidos para propósitos de prueba. Ideal para desarrolladores que necesitan simular transacciones, validar sistemas de pago, o realizar pruebas de integración, CardTestLib simplifica la generación de números de tarjetas de crédito conformes al algoritmo de Luhn.

NPM Version

[!NOTE]
Esta libreria esta diseñada para hacer pruebas, no nos hacemos responsable de uso o cualquier accion dañina o freudulenta cometida con esta herramienta.

Funciones disponibles:

normalizeCardnumber(cardNumber: string): string

Esta funcion simplemente limpia los numeros de las tarjetas eliminando todo carracter no numerico

getBaseCardNumber(length: number = 15): string

Genera un conjunto de numeros aleatorios, por defecto 15 de ellos

getCheckDigit(cardNumbers: string): number

Genera el Digito validador a partir del algoritmo de luhn

const checkDigit = getCheckDigit("538423209172662");
console.log(checkDigit) // Result: 4

getCardNumber(): string

Gerera los numeros Aleatorios de las tarjetas Martercard, visa, American Express, Discover y Dinner Club

let cardnumber =  getCardNumber(); 
console.log(cardnumber) // Result: 5384232091726624

getVisaCardNumber(length = lengthsVisa.visa16): string

Genera los numeros Aleatorios de las tarjetas Visa. Por Defecto 16 digitos.

// lengthsVisa 
{
  visa12: 12,
  visa16: 16,
};
let cardnumber =  getVisaCardNumber()
console.log(cardnumber) // Result: 4603397902120974

getMasterCardNumber(): string

Genera los numeros Aleatorios de tarjetas Discover

let cardnumber =  getMasterCardNumber(); 
console.log(cardnumber) // Result: 5384232091726624

getAmexCardNumber(): string

Genera los numeros Aleatorios de tarjetas Discover

let cardnumber =  getAmexCardNumber(); 
console.log(cardnumber) // Result: 347421502794597

getDinnerClubCardNumber(length = lengthsDinner.dinner16): string

Genera los numeros Aleatorios de tarjetas Discover. por Defecto 16 digitos

// lengthsDinner 
{
  dinner14: 14,
  dinner16: 16,
  dinner19: 19,
}
let cardnumber =  getDinnerClubCardNumber(); 
console.log(cardnumber) // Result: 3049347614152231

getDiscoverCardNumber(): string

Genera los numeros Aleatorios de tarjetas Discover

let cardnumber =  getDiscoverCardNumber(); 
console.log(cardnumber) // Result: 6578262180674306

¿Cómo si los cardNumbers son Validos?

Esta libreria no esta diseñada para hacer comprobaciones, de querer comprobar puedes validar el formato con mi otra libreria creditCardProviders en cuanto a la validacion del mismo puedes usar el algoritmo de luhn

Tambien puede visitar paginas como Vcc Generator

	npm i creditCardProviders
const {getCardInfo} = require('creditCardProviders');
const {getCardNumber} = require('cardtestlib');

let cardnumber =  getCardNumber(); // 5384232091726624
let Cardinfo = getCardInfo(cardnumber) 
console.log(Cardinfo)
// Result: { type: 'mastercard', validLengths: [ 16 ], pinLength: 3 }