Add generate API, Prototype for developer, Clean data
Some checks failed
Deploy eCourt Note Web to Server / Validate Database Schema (Drizzle) (push) Successful in 5s
Deploy eCourt Note Web to Server / Build Web Docker Image (push) Failing after 1m11s
Deploy eCourt Note Web to Server / Deploy eCourt Note Web to Server (push) Has been skipped
Deploy eCourt Note Web to Server / Notify Deployment Status (push) Failing after 0s
Some checks failed
Deploy eCourt Note Web to Server / Validate Database Schema (Drizzle) (push) Successful in 5s
Deploy eCourt Note Web to Server / Build Web Docker Image (push) Failing after 1m11s
Deploy eCourt Note Web to Server / Deploy eCourt Note Web to Server (push) Has been skipped
Deploy eCourt Note Web to Server / Notify Deployment Status (push) Failing after 0s
This commit is contained in:
parent
6ce071ee14
commit
a3d14fd58d
26 changed files with 911 additions and 1267 deletions
|
|
@ -50,7 +50,7 @@ console.log('Is Signature Valid?:', isValid); // true
|
|||
* @param privateKeyHex คีย์ลับในรูปแบบ Hex String (ความยาว 64 ตัวอักษร)
|
||||
* @returns ลายเซ็น (Signature) ในรูปแบบ Hex String (ความยาว 128 ตัวอักษร)
|
||||
*/
|
||||
export function signDataEd25519(message: string | Buffer, privateKeyHex: string): string {
|
||||
export function signEd25519(message: string | Buffer, privateKeyHex: string): string {
|
||||
const rawKeyBuffer = Buffer.from(privateKeyHex, 'hex');
|
||||
// ตัดเอาเฉพาะ 32 bytes (Seed) กรณีที่ Hex ยาว 64 bytes (ที่ต่อกับ Public Key มา)
|
||||
const seed = rawKeyBuffer.length === 64 ? rawKeyBuffer.subarray(0, 32) : rawKeyBuffer;
|
||||
|
|
@ -76,7 +76,7 @@ export function signDataEd25519(message: string | Buffer, privateKeyHex: string)
|
|||
* @param publicKeyHex คีย์สาธารณะในรูปแบบ Hex String (ความยาว 64 ตัวอักษร)
|
||||
* @returns ผลลัพธ์ความถูกต้อง (true = ผ่าน, false = ไม่ผ่าน)
|
||||
*/
|
||||
export function verifyDataEd25519(message: string | Buffer, signatureHex: string, publicKeyHex: string): boolean {
|
||||
export function verifyEd25519(message: string | Buffer, signatureHex: string, publicKeyHex: string): boolean {
|
||||
try {
|
||||
const rawPublicKey = Buffer.from(publicKeyHex, 'hex');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue