Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/polds/check

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/polds/check

  • v0.0.0-20140309001905-915a2a6c1c74
  • Source
  • Go
  • Socket score

Version published
Created
Source

check

Validation Library for Go. API Documentation on go.pkgdoc.org. Inspiration and partial port from is.js

Installation

go get github.com/polds/check

Usage

Credit Card

To check if a credit card is a valid card

check.CreditCard("4111111111111111").CardIs("Any") // Returns true

To validate if a card is a specific type of card (Supported cards: American Express, Visa, Discover, Mastercard)

check.CreditCard("4111111111111111").CardIs("MasterCard") // Returns false

To determine the merchant of credit card

check.CreditCard("4111111111111111").Merchant() // Returns Visa

Email

To validate an email address

check.Email("test@test.com").IsValid() // Returns true

Zip Code

To validate if a provided zip code matches a target country standard

check.Zip("83406").OfCountry("us") // Returns true

Issues

  • Email regex fails: user@[IPv6:2001:db8:1ff::a0b:dbd0], postbox@com, admin@mailserver1. Besides those examples, regex is RFC compliant.

FAQs

Package last updated on 09 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc