diff --git a/README.md b/README.md index e215bc4..93709d0 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,14 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). +# LMTLab -## Getting Started +Source code of LMTLab -First, run the development server: - -```bash -npm run dev -# or -yarn dev -# or -pnpm dev -# or -bun dev ``` +# dev +npm i +npm run dev -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. - -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. - -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. - -## Learn More - -To learn more about Next.js, take a look at the following resources: - -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. - -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! - -## Deploy on Vercel - -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. - -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. +# release +npm i +npm build +# static export avliable at /out +``` \ No newline at end of file diff --git a/app/strcoder/algorithms.ts b/app/strcoder/algorithms.ts index 7b928f2..c11707d 100644 --- a/app/strcoder/algorithms.ts +++ b/app/strcoder/algorithms.ts @@ -1,4 +1,7 @@ import { enc, MD5, SHA1, SHA256, SHA512 } from 'crypto-js'; +import basex from 'base-x'; + +const BASE58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; export const hashAlgorithms = { 'SHA-1': (input: string) => { @@ -16,6 +19,9 @@ export const hashAlgorithms = { }; export const encodeAlgorithms = { + 'Base58': (input: string) => { + return basex(BASE58).encode(Buffer.from(input)); + }, 'Base64': (input: string) => { const wordArray = enc.Utf8.parse(input); return enc.Base64.stringify(wordArray); @@ -25,10 +31,16 @@ export const encodeAlgorithms = { }, 'URI Component': (input: string) => { return encodeURIComponent(input).toString(); + }, + 'Hex': (input: string) => { + return enc.Hex.stringify(enc.Utf8.parse(input)); } }; export const decodeAlgorithms = { + 'Base58': (input: string) => { + return Buffer.from(basex(BASE58).decode(input)).toString(); + }, 'Base64': (input: string) => { return enc.Base64.parse(input).toString(enc.Utf8); }, @@ -37,6 +49,9 @@ export const decodeAlgorithms = { }, 'URI Component': (input: string) => { return decodeURIComponent(input).toString(); + }, + 'Hex': (input: string) => { + return enc.Hex.parse(input).toString(enc.Utf8); } }; diff --git a/package.json b/package.json index 43cf597..8b5aeae 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "dependencies": { "@monaco-editor/react": "^4.6.0", "@nextui-org/react": "^2.4.8", + "base-x": "^5.0.0", "crypto-js": "^4.2.0", "framer-motion": "^11.11.0", "next": "14.2.14",