Sha256: 15d611a2f47004989ad851dfe64592f1c54cae77fcaa6ba084fdd5968386bd96
Contents?: true
Size: 549 Bytes
Versions: 34
Compression:
Stored size: 549 Bytes
Contents
'use strict'; var base64url = module.exports; base64url.unescape = function unescape (str) { return (str + Array(5 - str.length % 4) .join('=')) .replace(/\-/g, '+') .replace(/_/g, '/'); }; base64url.escape = function escape (str) { return str.replace(/\+/g, '-') .replace(/\//g, '_') .replace(/=/g, ''); }; base64url.encode = function encode (str) { return this.escape(new Buffer(str).toString('base64')); }; base64url.decode = function decode (str) { return new Buffer(this.unescape(str), 'base64').toString(); };
Version data entries
34 entries across 17 versions & 2 rubygems