How to use the DEFAULT_ENCODING function from crypto

Find comprehensive JavaScript crypto.DEFAULT_ENCODING code examples handpicked from public code repositorys.

186
187
188
189
190
191
192
193
194
195
196
197
    assert.deepStrictEqual(actual.toString('hex'), expected.toString('hex'));
  }));
}


{
  const defaultEncoding = crypto.DEFAULT_ENCODING;
  const defaults = { N: 16384, p: 1, r: 8 };
  const expected = crypto.scryptSync('pass', 'salt', 1, defaults);


  const testEncoding = 'latin1';
fork icon42
star icon19
watch icon0

262
263
264
265
266
267
268
269
270
271
called. Multiple calls to `verify.verify()` will result in an error being
thrown.

## `crypto` module methods and properties

### crypto.DEFAULT_ENCODING

The default encoding to use for functions that can take either strings
or [buffers][].  The default value is `'buffer'`, which makes methods default
to [`Buffer`][] objects.
fork icon0
star icon0
watch icon1