Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 608 Bytes

README.md

File metadata and controls

30 lines (21 loc) · 608 Bytes

URL Crypt

Library for encrypt and decrypt URL

Installation

pnpm add @tawasukha/urlcrypt

Commands

import { urlcrypt } from "@tawasukha/urlcrypt"

const crypto = urlcrypt({
  secret: "www88a8078385d0c", 
  pattern: "http://example.com/api/auth/:id"
})
const link = "https://sub.domain.com/api/oauth2/secret_path?secretparam=secretvalue"

const encrypted = crypto.encrypt(link)
const decrypted = crypto.decrypt(encrypted)
console.log("encrypted",ecrypted)
console.log("decrypted",decrypted)

Inspired from