Node.js ကျူတိုရီရယ်

Node.js ပင်မစာမျက်နှာ Node.js နိဒါန်း Node.js ကို စတင်လိုက်ပါ။ Node.js မော်ဂျူးများ Node.js HTTP မော်ဂျူး Node.js ဖိုင်စနစ် Node.js URL မော်ဂျူး Node.js NPM Node.js ပွဲများ Node.js ဖိုင်များ အပ်လုဒ်လုပ်ခြင်း။ Node.js အီးမေးလ်

Node.js MySQL

MySQL စတင်လိုက်ပါ။ MySQL ဒေတာဘေ့စ်ဖန်တီးပါ။ MySQL ဇယားဖန်တီးပါ။ MySQL ထဲသို့ ထည့်သွင်းပါ။ MySQL မှ ရွေးချယ်ပါ။ MySQL ဘယ်မှာလဲ။ MySQL Order By MySQL ကိုဖျက်ပါ။ MySQL Drop Table MySQL အပ်ဒိတ် MySQL ကန့်သတ်ချက် MySQL Join

Node.js MongoDB

MongoDB စတင်လိုက်ပါ။ MongoDB ဒေတာဘေ့စ်ဖန်တီးပါ။ MongoDB သည် Collection ကိုဖန်တီးပါ။ MongoDB ထည့်သွင်းပါ။ MongoDB ကိုရှာပါ။ MongoDB မေးခွန်း MongoDB အမျိုးအစား MongoDB ကိုဖျက်ပါ။ MongoDB Drop Collection MongoDB အပ်ဒိတ် MongoDB ကန့်သတ်ချက် MongoDB Join

Raspberry Pi

RasPi စတင်လိုက်ပါ။ RasPi GPIO နိဒါန်း RasPi မှိတ်တုတ်မှိတ်တုတ် LED RasPi LED နှင့် ခလုတ်နှိပ်ပါ။ RasPi စီးဆင်းနေသော LED များ RasPi WebSocket RasPi RGB LED WebSocket RasPi အစိတ်အပိုင်းများ

Node.js အ ကိုး အကား

Built-in Modules များ

Node.js Crypto Module

❮ Built-in Modules


ဥပမာ

'abc' စာသားကို စာဝှက်ပါ

var crypto = require('crypto');

var mykey = crypto.createCipher('aes-128-cbc', 'mypassword');
var mystr = mykey.update('abc', 'utf8', 'hex')
mystr += mykey.final('hex');

console.log(mystr); //34feb914c099df25794bf9ccb85bea72

ဥပမာ

'abc' သို့ ပြန်ဝှက်ရန်

var crypto = require('crypto');

var mykey = crypto.createDecipher('aes-128-cbc', 'mypassword');
var mystr = mykey.update('34feb914c099df25794bf9ccb85bea72', 'hex', 'utf8')
mystr += mykey.final('utf8');

console.log(mystr); //abc

အဓိပ္ပါယ်နှင့် အသုံးပြုမှု

crypto module သည် ကုဒ်ဝှက်ထားသော ဒေတာကို ကိုင်တွယ်သည့်နည်းလမ်းကို ပံ့ပိုးပေးသည်။


အထားအသို

သင့်အပလီကေးရှင်းတွင် crypto module အပါအဝင် syntax သည်-

var crypto = require('crypto');

Crypto Properties နှင့် Methods

Method Description
constants Returns an object containing Crypto Constants
fips Checks if a FIPS crypto provider is in use
createCipher() Creates a Cipher object using the specific algorithm and password
createCipheriv() Creates a Cipher object using the specific algorithm, password and initialization vector
createDecipher() Creates a Decipher object using the specific algorithm and password
createDecipheriv() Creates a Decipher object using the specific algorithm, password and initialization vector
createDiffieHellman() Creates a DiffieHellman key exchange object
createECDH() Creates an Elliptic Curve Diffie Hellmann key exchange object
createHash() Creates a Hash object using the specified algorithm
createHmac() Creates a Hmac object using the specified algorithm and key
createSign() Creates a Sign object using the specified algorithm and key
createVerify() Creates a Verify object using the specified algorithm
getCiphers Returns an array of supported cipher algorithms
getCurves() Returns an array of supported elliptic curves
getDiffieHellman() Returns a predefined Diffie Hellman key exchange object
getHashes() Returns an array of supported hash algorithms
pbkdf2() Creates a Password Based Key Derivation Function 2 implementation
pbkdf2Sync() Creates a synchronous Password Based Key Derivation Function 2 implementation
privateDecrypt() Decrypts data using a private key
timingSafeEqual() Compare two Buffers and returns true is they are equal, otherwise false
privateEncrypt() Encrypts data using a private key
publicDecrypt() Decrypts data using a public key
publicEncrypt() Encrypts data using a public key
randomBytes() Creates random data
setEngine() Sets the engine for some or all OpenSSL function

❮ Built-in Modules