From 7c73a549370b878a2b8e5b8bcd755b96c7deaa18 Mon Sep 17 00:00:00 2001 From: Oleg Kovalov Date: Fri, 18 Sep 2020 06:48:16 +0200 Subject: [PATCH] rename internal method (#71) --- parse.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parse.go b/parse.go index d6d8025..5ca3d7e 100644 --- a/parse.go +++ b/parse.go @@ -6,7 +6,7 @@ import ( "encoding/json" ) -var base64Decode = base64.RawURLEncoding.Decode +var b64Decode = base64.RawURLEncoding.Decode // ParseString decodes a token. func ParseString(raw string) (*Token, error) { @@ -23,7 +23,7 @@ func Parse(raw []byte) (*Token, error) { buf := make([]byte, len(raw)) - headerN, err := base64Decode(buf, raw[:dot1]) + headerN, err := b64Decode(buf, raw[:dot1]) if err != nil { return nil, ErrInvalidFormat } @@ -32,13 +32,13 @@ func Parse(raw []byte) (*Token, error) { return nil, ErrInvalidFormat } - claimsN, err := base64Decode(buf[headerN:], raw[dot1+1:dot2]) + claimsN, err := b64Decode(buf[headerN:], raw[dot1+1:dot2]) if err != nil { return nil, ErrInvalidFormat } claims := buf[headerN : headerN+claimsN] - signN, err := base64Decode(buf[headerN+claimsN:], raw[dot2+1:]) + signN, err := b64Decode(buf[headerN+claimsN:], raw[dot2+1:]) if err != nil { return nil, ErrInvalidFormat }