அனைத்து திட்டங்கள்

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