%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home2/rezakur1/api.rezakurnia.com/zh-router/scripts/
Upload File :
Create Path :
Current File : /home2/rezakur1/api.rezakurnia.com/zh-router/scripts/create-api-key.js

import {randomBytes,createHash} from 'node:crypto';
const key='kd_live_'+randomBytes(24).toString('hex');
const hash=createHash('sha256').update(key).digest('hex');
console.log('Save this key; it is shown only once:\\n'+key);
console.log('Insert this hash into api_keys.key_hash:\\n'+hash);
console.log(`INSERT INTO api_keys(user_id,name,key_prefix,key_hash,credit_balance,is_active) VALUES(USER_ID,'My API Key','${key.slice(0,15)}','${hash}',10.000000,1);`);

Zerion Mini Shell 1.0