From 4b1309ee6f33e92db4ddb9f316f62e2d3528d673 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 29 Feb 2016 08:05:25 -0800 Subject: [PATCH] make internal/external naming consistent --- lib/b64.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/b64.js b/lib/b64.js index 5df334c..30b5764 100644 --- a/lib/b64.js +++ b/lib/b64.js @@ -1,5 +1,8 @@ 'use strict' +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray + var i var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' var lookup = [] @@ -23,7 +26,7 @@ function decode (elt) { return v !== undefined ? v : -1 } -function b64ToByteArray (b64) { +function toByteArray (b64) { var i, j, l, tmp, placeHolders, arr if (b64.length % 4 > 0) { @@ -87,7 +90,7 @@ function encodeChunk (uint8, start, end) { return output.join('') } -function uint8ToBase64 (uint8) { +function fromByteArray (uint8) { var i var extraBytes = uint8.length % 3 // if we have 1 byte left, pad 2 bytes var output = '' @@ -124,6 +127,3 @@ function uint8ToBase64 (uint8) { return parts.join('') } - -exports.toByteArray = b64ToByteArray -exports.fromByteArray = uint8ToBase64