Computer scienceBackendNode.jsCore ConceptsInternal modulesOther modulesHashing: overviewHash function

Intro to crypto module

Simple hash

Report a typo

Hash the given string using specified variables.

Sample Input 1:

No pain, no gain :)

Sample Output 1:

BoxDo1FeHKDvxR3kn1UklVEHY3ulgbgknyTjuZ2RQF0=
Write a program in JavaScript
const crypto = require('crypto');

const algo = 'blake2s256';
const message = 'No pain, no gain :)';
const encoding = 'base64';

const generatedHash = /* write your code here */
const updated = /* write your code here */
const hashed = /* write your code here */
___

Create a free account to access the full topic