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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tatil/crypto

v0.0.3

Published

Tatilsepeti Crypto utilities for encryption and decryption

Readme

@tatil/crypto

Tatilsepeti projeleri için şifreleme ve deşifreme işlemlerini içeren paket.

Özellikler

API-Based Encryption/Decryption (Client-Side)

  • Reservation ID şifreleme/deşifreleme
  • API endpoint üzerinden işlem yapar
  • Client-side kullanım için uygun

Local AES-256 Encryption (Server-Side)

  • AES-256-CBC algoritması
  • Gzip compression ile veri sıkıştırma
  • URL-safe base64 encoding
  • Server-side sadece (Node.js crypto module)

Kurulum

yarn add @tatil/crypto

Kullanım

API-Based Encryption (Client-Side)

import { encryption, decryption } from '@tatil/crypto';

// Reservation ID şifreleme
const encryptedId = await encryption(12345);

// Reservation ID deşifreleme
const decryptedId = await decryption('encrypted_string_here');

Local AES-256 Encryption (Server-Side)

import { encrypt, decrypt } from '@tatil/crypto';

// Veri şifreleme
const data = { userId: 123, email: '[email protected]' };
const encrypted = await encrypt(data);
// Sonuç: "base64_encoded_string"

// Veri deşifreleme
const decrypted = await decrypt(encrypted);
// Sonuç: { userId: 123, email: '[email protected]' }

Environment Variables

CRYPTO_SECRET_KEY=your_32_byte_secret_key_here

Önemli: encrypt ve decrypt fonksiyonları için CRYPTO_SECRET_KEY environment variable'si gereklidir.

API Reference

encryption(value)

Reservation ID'yi şifreler (API tabanlı)

  • Parametreler: value (string|number) - Şifrelenecek değer
  • Dönüş: Promise - Şifrelenmiş değer
  • Kullanım: Client-side

decryption(value)

Şifrelenmiş Reservation ID'yi çözer (API tabanlı)

  • Parametreler: value (string|number) - Çözülecek şifreli değer
  • Dönüş: Promise - Çözülmüş sayısal değer
  • Kullanım: Client-side

encrypt(data, secretKey?)

Veriyi AES-256-CBC ile şifreler (Yerel)

  • Parametreler:
    • data (Object|string) - Şifrelenecek veri
    • secretKey (string, optional) - Gizli anahtar (default: process.env.CRYPTO_SECRET_KEY)
  • Dönüş: Promise - Base64 encoded şifreli veri
  • Kullanım: Server-side only

decrypt(encryptedData, secretKey?)

Şifrelenmiş veriyi çözer (Yerel)

  • Parametreler:
    • encryptedData (string) - Şifreli veri (base64)
    • secretKey (string, optional) - Gizli anahtar (default: process.env.CRYPTO_SECRET_KEY)
  • Dönüş: Promise<Object|string> - Çözülmüş veri
  • Kullanım: Server-side only

Bağımlılıklar

  • @tatil/client-api: API-based işlemler için
  • crypto (Node.js built-in): AES-256 şifreleme için
  • zlib (Node.js built-in): Gzip compression için

Örnek Kullanım Senaryoları

1. Reservation ID Şifreleme (URL'de güvenli taşıma)

// Client-side
import { encryption } from '@tatil/crypto';

const reservationId = 12345;
const encryptedId = await encryption(reservationId);

// URL oluşturma
const url = `/reservation/${encodeURIComponent(encryptedId)}`;

2. Server-Side Veri Şifreleme

// Server component veya API route
import { encrypt, decrypt } from '@tatil/crypto';

// Hassas veriyi şifreleme
const userData = {
  id: 123,
  email: '[email protected]',
  phone: '+905551234567'
};

const encrypted = await encrypt(userData);

// Veriyi geri çözme
const decrypted = await decrypt(encrypted);

3. Next.js API Route

// app/api/v5/crypto/route.js
import { encrypt, decrypt } from '@tatil/crypto';
import { createResponse, createErrorResponse } from '@tatil/server-api';

export const POST = async (request) => {
  const { action, data } = await request.json();

  if (action === 'encrypt') {
    const encrypted = await encrypt(data);
    return createResponse('success', encrypted);
  }

  if (action === 'decrypt') {
    const decrypted = await decrypt(data);
    return createResponse('success', decrypted);
  }
};

Lisans

MIT

İletişim

Sorularınız için: Yaşar İçli [email protected]