💯 JWK to SSH in a lightweight, zero-dependency library.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

27 lines
559 B

'use strict';
var Enc = module.exports;
Enc.base64ToHex = function (b64) {
return Buffer.from(b64, 'base64').toString('hex');
};
Enc.binToBuf = function (bin) {
return Buffer.from(bin, 'binary');
};
Enc.bufToBase64 = function (u8) {
return Buffer.from(u8).toString('base64');
};
Enc.binToHex = function (bin) {
return Buffer.from(bin, 'binary').toString('hex');
};
Enc.hexToBase64 = function (hex) {
return Buffer.from(hex, 'hex').toString('base64');
};
Enc.hexToBin = function (hex) {
return Buffer.from(hex, 'hex').toString('binary');
};