[go: up one dir, main page]

cf-email

1.0.2 • Public • Published

cf-email

Easily decode Cloudflare Scrape Shield protected email addresses.

Usage

import { decode } from "cf-email";

const obfuscatedEmail = "006a6f686e2e646f65406578616d706c652e636f6d";
const email = decode(obfuscatedEmail);
email === "john.doe@example.com";
import { encode } from "cf-email";
import { KeyRange } from "cf-email/types";

const email = "john.doe@example.com";

// When generating a random value we need to use the KeyRange type.
const key = Math.round(Math.random() * 255) as KeyRange;
// Else we can just use a number between 0 and 255.
const key = 80;

const obfuscatedEmail = encode(email, key);
obfuscatedEmail === "503a3f383e7e343f35103528313d203c357e333f3d";

Package Sidebar

Install

npm i cf-email

Weekly Downloads

1

Version

1.0.2

License

GPL-3.0-only

Unpacked Size

43.2 kB

Total Files

9

Last publish

Collaborators

  • qtchaossss