UNPKG

@root/pem

Version:

VanillaJS, Lightweight, Zero-Dependency, PEM encoder and decoder.

13 lines (9 loc) 266 B
'use strict'; // "A little copying is better than a little dependency" - Rob Pike var Enc = module.exports; Enc.bufToBase64 = function(buf) { return Buffer.from(buf).toString('base64'); }; Enc.base64ToBuf = function(b64) { return Buffer.from(b64, 'base64'); };