โปรเจกต์ทั้งหมด

HSC

Human Short Code (HSC)

เปิดตัวแล้ว

เวอร์ชัน
1.0.3
สัญญาอนุญาต
MIT
สแตก
TypeScriptPython

เบื่อรหัส ID ที่ไม่มีความหมายหรือยัง? HSC แปลง ID ที่คัดลอกยากให้เป็นรูปแบบที่มนุษย์อ่านได้อย่างปลอดภัย

ตัวอย่าง

$ npm i human-short-code
import { hsc } from "human-short-code";

const myNumber = 123456789;

// Encode number to short code
const shortCode = hsc.encode(myNumber);
console.log(shortCode); // Example output: "QIUN-ESAD"

// Decode short code back to number
const originalNumber = hsc.decode(shortCode);
console.log(originalNumber); // 123456789

// Verify if a code is valid
const isValid = hsc.verify(shortCode);
console.log(isValid); // true