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

Version Path
hooch-0.4.2 jasmine/node_modules/karma/node_modules/connect/node_modules/express-session/node_modules/uid-safe/node_modules/base64-url/index.js
hooch-0.4.2 jasmine/node_modules/karma/node_modules/connect/node_modules/csurf/node_modules/csrf/node_modules/base64-url/index.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/connect/node_modules/express-session/node_modules/uid-safe/node_modules/base64-url/index.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/connect/node_modules/csurf/node_modules/csrf/node_modules/base64-url/index.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/connect/node_modules/csurf/node_modules/csrf/node_modules/base64-url/index.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/connect/node_modules/express-session/node_modules/uid-safe/node_modules/base64-url/index.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/connect/node_modules/csurf/node_modules/csrf/node_modules/base64-url/index.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/connect/node_modules/express-session/node_modules/uid-safe/node_modules/base64-url/index.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/connect/node_modules/express-session/node_modules/uid-safe/node_modules/base64-url/index.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/connect/node_modules/csurf/node_modules/csrf/node_modules/base64-url/index.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/connect/node_modules/express-session/node_modules/uid-safe/node_modules/base64-url/index.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/connect/node_modules/csurf/node_modules/csrf/node_modules/base64-url/index.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/connect/node_modules/csurf/node_modules/csrf/node_modules/base64-url/index.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/connect/node_modules/express-session/node_modules/uid-safe/node_modules/base64-url/index.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/connect/node_modules/express-session/node_modules/uid-safe/node_modules/base64-url/index.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/connect/node_modules/csurf/node_modules/csrf/node_modules/base64-url/index.js
hooch-0.0.7 jasmine/node_modules/karma/node_modules/connect/node_modules/express-session/node_modules/uid-safe/node_modules/base64-url/index.js
hooch-0.0.7 jasmine/node_modules/karma/node_modules/connect/node_modules/csurf/node_modules/csrf/node_modules/base64-url/index.js
hooch-0.0.6 jasmine/node_modules/karma/node_modules/connect/node_modules/express-session/node_modules/uid-safe/node_modules/base64-url/index.js
hooch-0.0.6 jasmine/node_modules/karma/node_modules/connect/node_modules/csurf/node_modules/csrf/node_modules/base64-url/index.js