• This project
    • Loading...
  • Sign in

은승우 / LINEBOT

%ea%b7%b8%eb%a6%bc1
Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • LINEBOT
  • node_modules
  • @root
  • pem
  • packer.js
  • 은승우's avatar
    all add · d8f4c3a1
    d8f4c3a1
    은승우 authored 2019-12-05 01:37:20 +0900
packer.js 370 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
'use strict';

var PEM = module.exports;

//var Enc = require('@root/encoding/base64');
var Enc = require('./node/native.js');

PEM.packBlock = function(opts) {
	// TODO allow for headers?
	return (
		'-----BEGIN ' +
		opts.type +
		'-----\n' +
		Enc.bufToBase64(opts.bytes)
			.match(/.{1,64}/g)
			.join('\n') +
		'\n' +
		'-----END ' +
		opts.type +
		'-----'
	);
};