
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 33676 Articles for Programming

7K+ Views
The buffer object can be encoded and decoded into Base64 string. The buffer class can be used to encode a string into a series of bytes. The Buffer.from() method takes a string as an input and converts it into Base64.The converted bytes can be changed again into String. The toString() method is used for converting the Base64 buffer back into the string format.SyntaxBuffer.from(string, [encoding]) object.toString(encoding)ParametersThe parameters are described below:string − This input parameter takes input for the string that will be encoded into the base64 format.encoding − This input parameter takes input for the encoding in which string will be encoded and ... Read More

2K+ Views
The util.format() method returns a formatted string that will use the first argument as a printf like format string. This format can also contain zero or more format specifiers. These specifiers can be replaced with the converted value from the corresponding argument.Following are some of the formatted specifiers:%s − String will be used to convert all values except bigInt, object and -0.%d − In this case, number will be used to convert all values except BigInt and symbo%i − parseInt(value, 10) will be used for all values except BigInt and symbol.%f − parseFloat(value) will be used for all values except Symbol%j − This format ... Read More

596 Views
The util.callbackify() method takes an async function as a parameter (or a function with Promise) and returns a function with the callback style. The callback will hold the rejection reason as the first parameter (or null in case of Promise) and the resolved value as the second parameter.Syntaxutil.callbackify(function)Parametersfunction − The input parameter for the async_function required for callback.Example 1Create a file "callbackify.js" and copy the following code snippet. After creating the file, use the command "node callbackify.js" to run this code.// util.callbackify() demo example // Importing the util module const util = require('util'); // Defining a simple async function ... Read More

1K+ Views
The Hmac class is one of the many utility classes that is used for creating the cryptographic HMAC digests. The Hmac.digest() method is used for calculating all the data that is updated using the Hmac.update() method. If encoding is provided, a string will be returned, else a buffer is returned.Syntaxhmac.digest( [encoding] )Parametersencoding − This input parameter takes input for the encoding to be considered while calculating hmac.Example 1Create a file "hmacDigest.js" and copy the following code snippet. After creating the file use, use the command "node hmacDigest.js" to run this code. Live Demo// Hmac.digest() Demo Example // Importing the crypto module ... Read More

306 Views
The Hash class is one of the many utility classes that is used for creating the hash digests of data. The hash.copy() method creates a new Hash object that will contain a deep copy of the internal state of the current hash object.Syntaxhash.copy([options])Parametersoptions −This input parameter takes input to control the stream behaviour and therefore will contain the stream.tranformOptions.Example 1Create a file "hashCopy.js" and copy the following code snippet. After creating the file, use the command "node hashCopy.js" to run this code.// hash.update() demo Example // Importing the crypto module const crypto = require('crypto'); // Defining the hash ... Read More

563 Views
The util.inherits() method basically inherits the methods from one construct to another. This prototype will be set to a new object to that from the superConstructor.By doing this, we can mainly add some validations to the top of Object.setPrototypeOf(constructor.prototype, superConstructor.prototype).Syntaxutil.inherits(constructor, superConstructor)ParametersThe parameters are described below -constructor − This is a function type input that holds the prototype for constructor the user wants to be inherited.superConstructor − This is the function that will be used for adding and validating the input validations.Example 1Create a file "inherits.js" and copy the following code snippet. After creating the file, use the command "node inherits.js" to run ... Read More

1K+ Views
The util.inspect() method returns the string representation of the objects that are intended for the debugging process.Syntaxutil.inspect(object, [showHidden], [depth], [colors])ParametersThe parameters are defined as below:object − A JavaScript primitive type or an object is given as input.optionsshowHidden − This is set as false by default. If true, this option includes the non-enumerable symbols and properties that are included in the formatted result. WeakMap and WeakSet are also included.depth − It specifies the number of recursions to be applied while formatting objects.colors − The output is set styled with ANSI color codes if this value is set to true. Colors passed are customizable.customInspect − The ... Read More

663 Views
The timer module in Node.js consists of different functions that can control and alter the timings of code execution. In this article, we will see how to use some of these functions.setTimeout() MethodThe setTimeout() method schedules the code execution after a designated amount of milliseconds. Only after the timeout has occurred, the code will be executed. The specified function will be executed only once. This method returns an ID that can be used in clearTimeout() method.SyntaxsetTimeout(function, delay, [args])ParametersThe parameters are defined below:function − This parameter takes input for the function that will be executed.delay − This is the time duration after which ... Read More

131 Views
The util.types.isInt32Array() method checks whether the passed value is a built-in Int32Array instance or not. If the above condition is satisfied, it returns True, else False.Syntaxutil.types.isInt32Array(value)Parametersvalue − This input takes input for the required parameter and checks if it's an Int32Array instance or not. Returns True or False based upon the input value passed.Example 1Create a file with name isInt32Array.js and copy the below code snippet.After creating the file, use the following command to run this code and check the output -node isInt32Array.jsProgram Code// util.types.isInt32Array() Demo Example // Importing the util module const util = require('util'); // Passing normal ... Read More

309 Views
A variety of undergraduate and graduate programs are available at Indiana University's Kelley School of Business, which is located in the university's business college. These programs include debt financing, accounting, marketing, and management. According to the U.S. News and World Report, it is consistently ranked among the top 25 business schools in the country.Key Points BrieflyEstablished in 1920, the Kelley School of Business is a private institution of higher learning. It has locations on the Indiana University Bloomington and Indianapolis campuses, as well as in Indianapolis. 2Additionally, in addition to the full-time MBA, students can pursue an online MBA or ... Read More