Skip to content

Instantly share code, notes, and snippets.

@konsorten-michael
Last active May 16, 2017 23:50
Show Gist options
  • Save konsorten-michael/accc406e042e284e2a6ff915a865b100 to your computer and use it in GitHub Desktop.
Save konsorten-michael/accc406e042e284e2a6ff915a865b100 to your computer and use it in GitHub Desktop.
Regular expressions for api keys and more of various services and apis
/* Expressions used multiple times
************************************/
/* MD5 hash */
const REGEX_MD5_HASH = /^[a-f0-9]{32}$/i;
/* SendGrid (https://sendgrid.com/)
************************************/
/* API key */
const REGEX_SENDGRID_API_KEY = /^SG.[A-z0-9]{22}.[A-z0-9\-_]{43}/;
/* ID of a recipient at the contacts database. */
const REGEX_SENDGRID_RECIPIENT_ID = REGEX_MD5_HASH; /* The ID is always the md5 hash of the contacts e-mail. */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment